bpftool: clean-up usage of libbpf_get_error()
authorSahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Sun, 20 Nov 2022 11:26:32 +0000 (11:26 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 21 Nov 2022 00:17:46 +0000 (16:17 -0800)
commitd1313e01271d2d8f33d6c82f1afb77e820a3540d
treee7a0281a2a91ead5a617012aa687c8cd0c72f06c
parentd2973ffd25c2295055349212ca26c18929e5e9f5
bpftool: clean-up usage of libbpf_get_error()

bpftool is now totally compliant with libbpf 1.0 mode and is not
expected to be compiled with pre-1.0, let's clean-up the usage of
libbpf_get_error().

The changes stay aligned with returned errors always negative.

- In tools/bpf/bpftool/btf.c This fixes an uninitialized local
variable `err` in function do_dump() because it may now be returned
without having been set.
- This also removes the checks on NULL pointers before calling
btf__free() because that function already does the check.

Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Link: https://lore.kernel.org/r/20221120112515.38165-5-sahid.ferdjaoui@industrialdiscipline.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/btf.c
tools/bpf/bpftool/btf_dumper.c
tools/bpf/bpftool/gen.c
tools/bpf/bpftool/iter.c
tools/bpf/bpftool/main.c
tools/bpf/bpftool/map.c
tools/bpf/bpftool/prog.c
tools/bpf/bpftool/struct_ops.c