Commit 8c7a9552 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov
Browse files

selftests/bpf: Fix bpf_object leak in skb_ctx selftest



skb_ctx selftest didn't close bpf_object implicitly allocated by
bpf_prog_test_load() helper. Fix the problem by explicitly calling
bpf_object__close() at the end of the test.

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-10-andrii@kernel.org
parent f91231ee
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -111,4 +111,6 @@ void test_skb_ctx(void)
		   "ctx_out_mark",
		   "skb->mark == %u, expected %d\n",
		   skb.mark, 10);

	bpf_object__close(obj);
}