提交 26545540 编写于 作者: K Kumar Kartikeya Dwivedi 提交者: Zheng Zengkai

libbpf: Remove unneeded check for flags during tc detach

mainline inclusion
from mainline-5.14-rc1
commit 4e164f87
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4e164f8716853b879e2b1a21a12d54c57f11372e

-------------------------------------------------

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
(cherry picked from commit 4e164f87)
Signed-off-by: NWang Yufen <wangyufen@huawei.com>
上级 55d7e99d
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册