Skip to content

Commit

Permalink
bpf, x86/arm64: remove useless checks on prog
Browse files Browse the repository at this point in the history
There is never such a situation, where bpf_int_jit_compile() is
called with either prog as NULL or len as 0, so the tests are
unnecessary and confusing as people would just copy them. s390
doesn't have them, so no change is needed there.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed May 16, 2016
1 parent 6077776 commit 93a73d4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions arch/arm64/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,6 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
if (!bpf_jit_enable)
return;

if (!prog || !prog->len)
return;

memset(&ctx, 0, sizeof(ctx));
ctx.prog = prog;

Expand Down
3 changes: 0 additions & 3 deletions arch/x86/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,9 +1086,6 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
if (!bpf_jit_enable)
return;

if (!prog || !prog->len)
return;

addrs = kmalloc(prog->len * sizeof(*addrs), GFP_KERNEL);
if (!addrs)
return;
Expand Down

0 comments on commit 93a73d4

Please sign in to comment.