提交 4e164f87 编写于 作者: K Kumar Kartikeya Dwivedi 提交者: Daniel Borkmann

libbpf: Remove unneeded check for flags during tc detach

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: 715c5ce4 ("libbpf: Add low level TC-BPF management API")
Signed-off-by: NKumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210612023502.1283837-2-memxor@gmail.com
上级 ca16b429
...@@ -675,8 +675,6 @@ static int __bpf_tc_detach(const struct bpf_tc_hook *hook, ...@@ -675,8 +675,6 @@ static int __bpf_tc_detach(const struct bpf_tc_hook *hook,
return -EINVAL; return -EINVAL;
if (priority > UINT16_MAX) if (priority > UINT16_MAX)
return -EINVAL; return -EINVAL;
if (flags & ~BPF_TC_F_REPLACE)
return -EINVAL;
if (!flush) { if (!flush) {
if (!handle || !priority) if (!handle || !priority)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册