Commit f338ac91 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov

selftests/bpf: fix double bpf_object__close() in veristate

bpf_object__close(obj) is called twice for BPF object files with single
BPF program in it. This causes crash. Fix this by not calling
bpf_object__close() unnecessarily.

Fixes: c8bc5e05 ("selftests/bpf: Add veristat tool for mass-verifying BPF object files")
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20220921164254.3630690-2-andrii@kernel.orgSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 2d863b14
...@@ -300,7 +300,6 @@ static int process_obj(const char *filename) ...@@ -300,7 +300,6 @@ static int process_obj(const char *filename)
prog = bpf_object__next_program(obj, NULL); prog = bpf_object__next_program(obj, NULL);
bpf_program__set_autoload(prog, true); bpf_program__set_autoload(prog, true);
process_prog(filename, obj, prog); process_prog(filename, obj, prog);
bpf_object__close(obj);
goto cleanup; goto cleanup;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment