[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220917084248.3649-1-williamsukatube@163.com>
Date: Sat, 17 Sep 2022 16:42:48 +0800
From: williamsukatube@....com
To: martin.lau@...ux.dev, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
song@...nel.org, yhs@...com, john.fastabend@...il.com,
kpsingh@...nel.org, sdf@...gle.com, haoluo@...gle.com,
jolsa@...nel.org, William Dean <williamsukatube@....com>
Subject: [PATCH -next] bpf: simplify code in btf_parse_hdr
From: William Dean <williamsukatube@....com>
It could directly return 'btf_check_sec_info' to simplify code.
Signed-off-by: William Dean <williamsukatube@....com>
---
kernel/bpf/btf.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 7e64447659f3..80eda86ddfce 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,
--
2.25.1
Powered by blists - more mailing lists