提交 57b7bdeb 编写于 作者: A Andrii Nakryiko 提交者: Zheng Zengkai

selftests/bpf: Avoid duplicate btf__parse() call

mainline inclusion
from mainline-5.17-rc1
commit f92321d7
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f92321d706a810b89a905e04658e38931c4bb0e0

-------------------------------------------------

btf__parse() is repeated after successful setup, leaving the first
instance leaked. Remove redundant and premature call.
Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Reviewed-by: NHengqi Chen <hengqi.chen@gmail.com>
Link: https://lore.kernel.org/bpf/20211107165521.9240-8-andrii@kernel.org
(cherry picked from commit f92321d7)
Signed-off-by: NWang Yufen <wangyufen@huawei.com>
上级 ef1a8bb4
...@@ -432,7 +432,7 @@ static int setup_type_id_case_local(struct core_reloc_test_case *test) ...@@ -432,7 +432,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) { static int setup_type_id_case_success(struct core_reloc_test_case *test) {
struct core_reloc_type_id_output *exp = (void *)test->output; 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; int err;
err = setup_type_id_case_local(test); err = setup_type_id_case_local(test);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册