diff options
author | Song Liu <songliubraving@fb.com> | 2018-12-10 20:17:50 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-12-10 23:48:42 +0100 |
commit | 7a5725ddc6e18aab61f647c0996d3b7eb03ff5cb (patch) | |
tree | fa9889b9460e19a2369d70f18e04e3ebc942a337 /kernel/bpf/syscall.c | |
parent | bpf: bpftool: Fix newline and p_err issue (diff) | |
download | linux-7a5725ddc6e18aab61f647c0996d3b7eb03ff5cb.tar.xz linux-7a5725ddc6e18aab61f647c0996d3b7eb03ff5cb.zip |
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>
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r-- | kernel/bpf/syscall.c | 4 |
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, ulen = info.nr_jited_ksyms; info.nr_jited_ksyms = prog->aux->func_cnt ? : 1; - if (info.nr_jited_ksyms && ulen) { + if (ulen) { if (bpf_dump_raw_ok()) { unsigned long ksym_addr; u64 __user *user_ksyms; @@ -2240,7 +2240,7 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog, ulen = info.nr_jited_func_lens; info.nr_jited_func_lens = prog->aux->func_cnt ? : 1; - if (info.nr_jited_func_lens && ulen) { + if (ulen) { if (bpf_dump_raw_ok()) { u32 __user *user_lens; u32 func_len, i; |