mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 09:04:21 +08:00
selftest/bpf: Fix error usage of ASSERT_OK in xdp_adjust_tail.c
xdp_adjust_tail.c calls ASSERT_OK() to check the return value of
bpf_prog_test_load(), but the condition is not correct. Fix it.
Fixes: 791cad0250
("bpf: selftests: Get rid of CHECK macro in xdp_adjust_tail.c")
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/bpf/20221011120108.782373-7-xukuohai@huaweicloud.com
This commit is contained in:
parent
4abdb1d5b2
commit
cbc1c998da
@ -18,7 +18,7 @@ static void test_xdp_adjust_tail_shrink(void)
|
||||
);
|
||||
|
||||
err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd);
|
||||
if (ASSERT_OK(err, "test_xdp_adjust_tail_shrink"))
|
||||
if (!ASSERT_OK(err, "test_xdp_adjust_tail_shrink"))
|
||||
return;
|
||||
|
||||
err = bpf_prog_test_run_opts(prog_fd, &topts);
|
||||
@ -53,7 +53,7 @@ static void test_xdp_adjust_tail_grow(void)
|
||||
);
|
||||
|
||||
err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd);
|
||||
if (ASSERT_OK(err, "test_xdp_adjust_tail_grow"))
|
||||
if (!ASSERT_OK(err, "test_xdp_adjust_tail_grow"))
|
||||
return;
|
||||
|
||||
err = bpf_prog_test_run_opts(prog_fd, &topts);
|
||||
@ -90,7 +90,7 @@ static void test_xdp_adjust_tail_grow2(void)
|
||||
);
|
||||
|
||||
err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd);
|
||||
if (ASSERT_OK(err, "test_xdp_adjust_tail_grow"))
|
||||
if (!ASSERT_OK(err, "test_xdp_adjust_tail_grow"))
|
||||
return;
|
||||
|
||||
/* Test case-64 */
|
||||
|
Loading…
Reference in New Issue
Block a user