bpf: Remove redundant initialization of variable allow
authorColin Ian King <colin.king@canonical.com>
Tue, 17 Aug 2021 17:08:42 +0000 (18:08 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 17 Aug 2021 21:09:12 +0000 (14:09 -0700)
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
kernel/bpf/cgroup.c

index a1dedba4c174998f11707a6225fe65e60ff6daf1..9f35928bab0ac34b54b941174872eece8e66d235 100644 (file)
@@ -1135,7 +1135,7 @@ int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor,
                .major = major,
                .minor = minor,
        };
-       int allow = 1;
+       int allow;
 
        rcu_read_lock();
        cgrp = task_dfl_cgroup(current);