]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
libbpf: Remove unneeded check for flags during tc detach
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Sat, 12 Jun 2021 02:35:00 +0000 (08:05 +0530)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 15 Jun 2021 11:58:56 +0000 (13:58 +0200)
Coverity complained about this being unreachable code. It is right
because we already enforce flags to be unset, so a check validating
the flag value is redundant.

Fixes: 715c5ce454a6 ("libbpf: Add low level TC-BPF management API")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210612023502.1283837-2-memxor@gmail.com
tools/lib/bpf/netlink.c

index d743c8721aa75cde51c3479dc79a64bfcd7370d2..efbb50ad59d81e248d50bf34006c8a80a77e4ab9 100644 (file)
@@ -675,8 +675,6 @@ static int __bpf_tc_detach(const struct bpf_tc_hook *hook,
                return -EINVAL;
        if (priority > UINT16_MAX)
                return -EINVAL;
-       if (flags & ~BPF_TC_F_REPLACE)
-               return -EINVAL;
        if (!flush) {
                if (!handle || !priority)
                        return -EINVAL;