Commit f91231ee authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov

selftests/bpf: Destroy XDP link correctly

bpf_link__detach() was confused with bpf_link__destroy() and leaves
leaked FD in the process. Fix the problem.
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Reviewed-by: default avatarHengqi Chen <hengqi.chen@gmail.com>
Link: https://lore.kernel.org/bpf/20211107165521.9240-9-andrii@kernel.org
parent f92321d7
...@@ -204,8 +204,8 @@ static int pass_ack(struct migrate_reuseport_test_case *test_case) ...@@ -204,8 +204,8 @@ static int pass_ack(struct migrate_reuseport_test_case *test_case)
{ {
int err; int err;
err = bpf_link__detach(test_case->link); err = bpf_link__destroy(test_case->link);
if (!ASSERT_OK(err, "bpf_link__detach")) if (!ASSERT_OK(err, "bpf_link__destroy"))
return -1; return -1;
test_case->link = NULL; test_case->link = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment