Skip to content

Commit

Permalink
selftests/bpf: fix double bpf_object__close() in veristate
Browse files Browse the repository at this point in the history
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: c8bc5e0 ("selftests/bpf: Add veristat tool for mass-verifying BPF object files")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20220921164254.3630690-2-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Andrii Nakryiko authored and Alexei Starovoitov committed Sep 22, 2022
1 parent 2d863b1 commit f338ac9
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion tools/testing/selftests/bpf/veristat.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ static int process_obj(const char *filename)
prog = bpf_object__next_program(obj, NULL);
bpf_program__set_autoload(prog, true);
process_prog(filename, obj, prog);
bpf_object__close(obj);
goto cleanup;
}

Expand Down

0 comments on commit f338ac9

Please sign in to comment.