mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
bpf: simplify code in btf_parse_hdr
It could directly return 'btf_check_sec_info' to simplify code. Signed-off-by: William Dean <williamsukatube@163.com> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/r/20220917084248.3649-1-williamsukatube@163.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
This commit is contained in:
parent
7620bffbf7
commit
3a74904cef
1 changed files with 1 additions and 6 deletions
|
@ -4854,7 +4854,6 @@ static int btf_parse_hdr(struct btf_verifier_env *env)
|
||||||
u32 hdr_len, hdr_copy, btf_data_size;
|
u32 hdr_len, hdr_copy, btf_data_size;
|
||||||
const struct btf_header *hdr;
|
const struct btf_header *hdr;
|
||||||
struct btf *btf;
|
struct btf *btf;
|
||||||
int err;
|
|
||||||
|
|
||||||
btf = env->btf;
|
btf = env->btf;
|
||||||
btf_data_size = btf->data_size;
|
btf_data_size = btf->data_size;
|
||||||
|
@ -4911,11 +4910,7 @@ static int btf_parse_hdr(struct btf_verifier_env *env)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = btf_check_sec_info(env, btf_data_size);
|
return btf_check_sec_info(env, btf_data_size);
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int btf_check_type_tags(struct btf_verifier_env *env,
|
static int btf_check_type_tags(struct btf_verifier_env *env,
|
||||||
|
|
Loading…
Reference in a new issue