From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
To: bpf@vger.kernel.org
Cc: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Toke Høiland-Jørgensen" <toke@redhat.com>,
netdev@vger.kernel.org
Subject: [PATCH bpf-next 1/3] libbpf: remove unneeded check for flags during detach
Date: Sat, 12 Jun 2021 08:05:00 +0530 [thread overview]
Message-ID: <20210612023502.1283837-2-memxor@gmail.com> (raw)
In-Reply-To: <20210612023502.1283837-1-memxor@gmail.com>
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.
CID: 322808
Fixes: 715c5ce454a6 ("libbpf: Add low level TC-BPF management API")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
---
tools/lib/bpf/netlink.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/lib/bpf/netlink.c b/tools/lib/bpf/netlink.c
index d743c8721aa7..efbb50ad59d8 100644
--- a/tools/lib/bpf/netlink.c
+++ b/tools/lib/bpf/netlink.c
@@ -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;
--
2.31.1
next prev parent reply other threads:[~2021-06-12 2:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-12 2:34 [PATCH bpf-next 0/3] Fixes for TC-BPF series Kumar Kartikeya Dwivedi
2021-06-12 2:35 ` Kumar Kartikeya Dwivedi [this message]
2021-06-12 2:35 ` [PATCH bpf-next 2/3] libbpf: set NLM_F_EXCL when creating qdisc Kumar Kartikeya Dwivedi
2021-06-12 2:35 ` [PATCH bpf-next 3/3] libbpf: add request buffer type for netlink messages Kumar Kartikeya Dwivedi
2021-06-15 12:23 ` Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210612023502.1283837-2-memxor@gmail.com \
--to=memxor@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--cc=toke@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).