Skip to content

Commit a9d2ccf

Browse files
anakryikogregkh
authored andcommitted
selftests/bpf: Fix bpf_object leak in skb_ctx selftest
[ Upstream commit 8c7a955 ] 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: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Reviewed-by: Hengqi Chen <hengqi.chen@gmail.com> Link: https://lore.kernel.org/bpf/20211107165521.9240-10-andrii@kernel.org Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent b207356 commit a9d2ccf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • tools/testing/selftests/bpf/prog_tests

‎tools/testing/selftests/bpf/prog_tests/skb_ctx.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,6 @@ void test_skb_ctx(void)
105105
"ctx_out_mark",
106106
"skb->mark == %u, expected %d\n",
107107
skb.mark, 10);
108+
109+
bpf_object__close(obj);
108110
}

0 commit comments

Comments
 (0)