Skip to content

Commit

Permalink
selftests/bpf: Avoid duplicate btf__parse() call
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Andrii Nakryiko authored and Alexei Starovoitov committed Nov 7, 2021
1 parent f795875 commit f92321d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/prog_tests/core_reloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f92321d

Please sign in to comment.