Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

William Dean and committed by
Martin KaFai Lau
3a74904c 7620bffb

+1 -6
+1 -6
kernel/bpf/btf.c
··· 4854 4854 u32 hdr_len, hdr_copy, btf_data_size; 4855 4855 const struct btf_header *hdr; 4856 4856 struct btf *btf; 4857 - int err; 4858 4857 4859 4858 btf = env->btf; 4860 4859 btf_data_size = btf->data_size; ··· 4910 4911 return -EINVAL; 4911 4912 } 4912 4913 4913 - err = btf_check_sec_info(env, btf_data_size); 4914 - if (err) 4915 - return err; 4916 - 4917 - return 0; 4914 + return btf_check_sec_info(env, btf_data_size); 4918 4915 } 4919 4916 4920 4917 static int btf_check_type_tags(struct btf_verifier_env *env,