summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorQuentin Monnet <quentin@isovalent.com>2021-07-29 19:20:24 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-15 11:02:16 +0300
commitd75d6b94aa32692b9ae982206327721a0e650fba (patch)
tree4856865d605c815ea920c1f692d1099e5ad82ba6 /tools/testing
parent3d79bc7e88a22371df575bb61fa2e18c61e08c58 (diff)
downloadlinux-d75d6b94aa32692b9ae982206327721a0e650fba.tar.xz
tools: Free BTF objects at various locations
[ Upstream commit 369e955b3d1c12f6ec2e51a95911bb80ada55d79 ] Make sure to call btf__free() (and not simply free(), which does not free all pointers stored in the struct) on pointers to struct btf objects retrieved at various locations. These were found while updating the calls to btf__get_from_id(). Fixes: 999d82cbc044 ("tools/bpf: enhance test_btf file testing to test func info") Fixes: 254471e57a86 ("tools/bpf: bpftool: add support for func types") Fixes: 7b612e291a5a ("perf tools: Synthesize PERF_RECORD_* for loaded BPF programs") Fixes: d56354dc4909 ("perf tools: Save bpf_prog_info and BTF of new BPF programs") Fixes: 47c09d6a9f67 ("bpftool: Introduce "prog profile" command") Fixes: fa853c4b839e ("perf stat: Enable counting events for BPF programs") Signed-off-by: Quentin Monnet <quentin@isovalent.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210729162028.29512-5-quentin@isovalent.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/btf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/btf.c b/tools/testing/selftests/bpf/prog_tests/btf.c
index 857e3f26086f..68e415f4d33c 100644
--- a/tools/testing/selftests/bpf/prog_tests/btf.c
+++ b/tools/testing/selftests/bpf/prog_tests/btf.c
@@ -4386,6 +4386,7 @@ skip:
fprintf(stderr, "OK");
done:
+ btf__free(btf);
free(func_info);
bpf_object__close(obj);
}