diff options
author | William Dean <williamsukatube@163.com> | 2022-09-17 16:42:48 +0800 |
---|---|---|
committer | Martin KaFai Lau <martin.lau@kernel.org> | 2022-09-21 10:28:46 -0700 |
commit | 3a74904ceff3ecdb9d6cc0844ed67df417968eb6 (patch) | |
tree | dda1f65af713e72d04891e893dd0138abdd3458d /kernel/bpf | |
parent | 7620bffbf72cd66a5d18e444a143b5b5989efa87 (diff) |
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>
Diffstat (limited to 'kernel/bpf')
-rw-r--r-- | kernel/bpf/btf.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index b3940c605aac..6ccd4f4d731e 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -4854,7 +4854,6 @@ static int btf_parse_hdr(struct btf_verifier_env *env) u32 hdr_len, hdr_copy, btf_data_size; const struct btf_header *hdr; struct btf *btf; - int err; btf = env->btf; btf_data_size = btf->data_size; @@ -4911,11 +4910,7 @@ static int btf_parse_hdr(struct btf_verifier_env *env) return -EINVAL; } - err = btf_check_sec_info(env, btf_data_size); - if (err) - return err; - - return 0; + return btf_check_sec_info(env, btf_data_size); } static int btf_check_type_tags(struct btf_verifier_env *env, |