selftests/bpf: Fix crash in core_reloc when bpftool btfgen fails
authorYucong Sun <fallentree@fb.com>
Thu, 17 Feb 2022 18:02:10 +0000 (10:02 -0800)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 17 Feb 2022 19:01:32 +0000 (11:01 -0800)
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
tools/testing/selftests/bpf/prog_tests/core_reloc.c

index baf53c2..8fbb40a 100644 (file)
@@ -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;
                }