selftests/bpf: Fix memory leak caused by not destroying skeleton
authorXu Kuohai <xukuohai@huawei.com>
Tue, 11 Oct 2022 12:01:05 +0000 (08:01 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:02 +0000 (13:32 +0100)
commitd7dc8fad67fab906530c50155b12cf6117e99299
tree4a747b8545e8f8daf9c3843e3912f1c3bd301dcf
parent13866e924a5760ee1ba9aa64dbfb5b44f4138c01
selftests/bpf: Fix memory leak caused by not destroying skeleton

[ Upstream commit 6e8280b958c5d7edc514cf347a800b23b7732b2b ]

Some test cases does not destroy skeleton object correctly, causing ASAN
to report memory leak warning. Fix it.

Fixes: 0ef6740e9777 ("selftests/bpf: Add tests for kptr_ref refcounting")
Fixes: 1642a3945e22 ("selftests/bpf: Add struct argument tests with fentry/fexit programs.")
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-4-xukuohai@huaweicloud.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/prog_tests/map_kptr.c
tools/testing/selftests/bpf/prog_tests/tracing_struct.c