selftests/bpf: Avoid duplicate btf__parse() call
authorAndrii Nakryiko <andrii@kernel.org>
Sun, 7 Nov 2021 16:55:19 +0000 (08:55 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 7 Nov 2021 17:14:15 +0000 (09:14 -0800)
btf__parse() is repeated after successful setup, leaving the first
instance leaked. Remove redundant and premature call.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Hengqi Chen <hengqi.chen@gmail.com>
Link: https://lore.kernel.org/bpf/20211107165521.9240-8-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/core_reloc.c

index 55ec85b..1041d0c 100644 (file)
@@ -433,7 +433,7 @@ static int setup_type_id_case_local(struct core_reloc_test_case *test)
 
 static int setup_type_id_case_success(struct core_reloc_test_case *test) {
        struct core_reloc_type_id_output *exp = (void *)test->output;
-       struct btf *targ_btf = btf__parse(test->btf_src_file, NULL);
+       struct btf *targ_btf;
        int err;
 
        err = setup_type_id_case_local(test);