aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2016-05-13 13:08:29 -0400
committerDavid S. Miller <davem@davemloft.net>2016-05-16 13:49:32 -0400
commit93a73d442d370e20ed1009cd79cb29c4d7c0ee86 (patch)
tree78a3fe950b254b80ab0414e473f4cda06ba271cd
parent6077776b5908e0493a3946f7d3bc63871b201e87 (diff)
bpf, x86/arm64: remove useless checks on prog
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>
-rw-r--r--arch/arm64/net/bpf_jit_comp.c3
-rw-r--r--arch/x86/net/bpf_jit_comp.c3
2 files changed, 0 insertions, 6 deletions
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index b405bbb54431..ef35e866caf7 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -772,9 +772,6 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
772 if (!bpf_jit_enable) 772 if (!bpf_jit_enable)
773 return; 773 return;
774 774
775 if (!prog || !prog->len)
776 return;
777
778 memset(&ctx, 0, sizeof(ctx)); 775 memset(&ctx, 0, sizeof(ctx));
779 ctx.prog = prog; 776 ctx.prog = prog;
780 777
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 4286f3618bd0..f5bfd4fd28dd 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -1086,9 +1086,6 @@ void bpf_int_jit_compile(struct bpf_prog *prog)
1086 if (!bpf_jit_enable) 1086 if (!bpf_jit_enable)
1087 return; 1087 return;
1088 1088
1089 if (!prog || !prog->len)
1090 return;
1091
1092 addrs = kmalloc(prog->len * sizeof(*addrs), GFP_KERNEL); 1089 addrs = kmalloc(prog->len * sizeof(*addrs), GFP_KERNEL);
1093 if (!addrs) 1090 if (!addrs)
1094 return; 1091 return;