Blob Blame History Raw
From: Colin Ian King <colin.king@canonical.com>
Date: Tue, 17 Aug 2021 18:08:42 +0100
Subject: bpf: Remove redundant initialization of variable allow
Patch-mainline: v5.15-rc1
Git-commit: 8cacfc85b615cc0bae01241593c4b25da6570efc
References: jsc#PED-1377

The variable allow is being initialized with a value that is never read, it
is being updated later on. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210817170842.495440-1-colin.king@canonical.com
Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
 kernel/bpf/cgroup.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -1135,7 +1135,7 @@ int __cgroup_bpf_check_dev_permission(sh
 		.major = major,
 		.minor = minor,
 	};
-	int allow = 1;
+	int allow;
 
 	rcu_read_lock();
 	cgrp = task_dfl_cgroup(current);