]> git.baikalelectronics.ru Git - kernel.git/commit
tools: Free BTF objects at various locations
authorQuentin Monnet <quentin@isovalent.com>
Thu, 29 Jul 2021 16:20:24 +0000 (17:20 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 30 Jul 2021 00:09:28 +0000 (17:09 -0700)
commitdbbf4af1cf2936ccb5b7bfd92fa822a3b9536ded
treecda3708bfee24ba3560e5f2b97a9526fb8992dcb
parent3511556918f9dcdb4dc861b3b5c49bb52ea5fa0d
tools: Free BTF objects at various locations

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: e86f8a886213 ("tools/bpf: enhance test_btf file testing to test func info")
Fixes: 1a11a7e20197 ("tools/bpf: bpftool: add support for func types")
Fixes: 5f18a01a3d37 ("perf tools: Synthesize PERF_RECORD_* for loaded BPF programs")
Fixes: 9ad58962e1aa ("perf tools: Save bpf_prog_info and BTF of new BPF programs")
Fixes: 9bd73659ff5a ("bpftool: Introduce "prog profile" command")
Fixes: 357a4e07d577 ("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
tools/bpf/bpftool/prog.c
tools/perf/util/bpf-event.c
tools/perf/util/bpf_counter.c
tools/testing/selftests/bpf/prog_tests/btf.c