aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2018-12-10 14:17:50 -0500
committerAlexei Starovoitov <ast@kernel.org>2018-12-10 17:48:42 -0500
commit7a5725ddc6e18aab61f647c0996d3b7eb03ff5cb (patch)
treefa9889b9460e19a2369d70f18e04e3ebc942a337
parent10a5ce98539948affbdc28dc0f39a1b6b2307f9d (diff)
bpf: clean up bpf_prog_get_info_by_fd()
info.nr_jited_ksyms and info.nr_jited_func_lens cannot be 0 in these two statements, so we don't need to check them. Signed-off-by: Song Liu <songliubraving@fb.com> Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r--kernel/bpf/syscall.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 19c88cff7880..a99a23bf5910 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2209,7 +2209,7 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
2209 2209
2210 ulen = info.nr_jited_ksyms; 2210 ulen = info.nr_jited_ksyms;
2211 info.nr_jited_ksyms = prog->aux->func_cnt ? : 1; 2211 info.nr_jited_ksyms = prog->aux->func_cnt ? : 1;
2212 if (info.nr_jited_ksyms && ulen) { 2212 if (ulen) {
2213 if (bpf_dump_raw_ok()) { 2213 if (bpf_dump_raw_ok()) {
2214 unsigned long ksym_addr; 2214 unsigned long ksym_addr;
2215 u64 __user *user_ksyms; 2215 u64 __user *user_ksyms;
@@ -2240,7 +2240,7 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
2240 2240
2241 ulen = info.nr_jited_func_lens; 2241 ulen = info.nr_jited_func_lens;
2242 info.nr_jited_func_lens = prog->aux->func_cnt ? : 1; 2242 info.nr_jited_func_lens = prog->aux->func_cnt ? : 1;
2243 if (info.nr_jited_func_lens && ulen) { 2243 if (ulen) {
2244 if (bpf_dump_raw_ok()) { 2244 if (bpf_dump_raw_ok()) {
2245 u32 __user *user_lens; 2245 u32 __user *user_lens;
2246 u32 func_len, i; 2246 u32 func_len, i;