selftests/bpf: Clean up btf and btf_dump in dump_datasec test
authorAndrii Nakryiko <andrii@kernel.org>
Sun, 7 Nov 2021 16:55:18 +0000 (08:55 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 7 Nov 2021 17:14:15 +0000 (09:14 -0800)
commitf79587520a6007a3734b23a3c2eb4c62aa457533
tree16da27ea76eba2c951a1640640d4be36ac7fb110
parent5309b516bcc6f76dda0e44a7a1824324277093d6
selftests/bpf: Clean up btf and btf_dump in dump_datasec test

Free up used resources at the end and on error. Also make it more
obvious that there is btf__parse() call that creates struct btf
instance.

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-7-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/btf_dump.c