Skip to content

Commit

Permalink
selftests/bpf: Fix crash in core_reloc when bpftool btfgen fails
Browse files Browse the repository at this point in the history
Avoid unnecessary goto cleanup, as there is nothing to clean up.

Signed-off-by: Yucong Sun <fallentree@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220217180210.2981502-1-fallentree@fb.com
  • Loading branch information
thefallentree authored and anakryiko committed Feb 17, 2022
1 parent b38101c commit b75daca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/bpf/prog_tests/core_reloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,12 +888,12 @@ static void run_core_reloc_tests(bool use_btfgen)

fd = mkstemp(btf_file);
if (!ASSERT_GE(fd, 0, "btf_tmp"))
goto cleanup;
continue;
close(fd); /* we only need the path */
err = run_btfgen(test_case->btf_src_file, btf_file,
test_case->bpf_obj_file);
if (!ASSERT_OK(err, "run_btfgen"))
goto cleanup;
continue;

test_case->btf_src_file = btf_file;
}
Expand Down

0 comments on commit b75daca

Please sign in to comment.