mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 10:01:00 +00:00
selftests/bpf: Fix bpf_object leak in skb_ctx selftest
[ Upstream commit 8c7a955201
]
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>
This commit is contained in:
parent
57d3ec1106
commit
1f1161c9bb
1 changed files with 2 additions and 0 deletions
|
@ -105,4 +105,6 @@ void test_skb_ctx(void)
|
|||
"ctx_out_mark",
|
||||
"skb->mark == %u, expected %d\n",
|
||||
skb.mark, 10);
|
||||
|
||||
bpf_object__close(obj);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue