[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <bd2c1206d14a65f7a2ef111c38b675d9ba771a82.1463158442.git.daniel@iogearbox.net>
Date: Fri, 13 May 2016 19:08:29 +0200
From: Daniel Borkmann <daniel@...earbox.net>
To: davem@...emloft.net
Cc: alexei.starovoitov@...il.com, elena.reshetova@...el.com,
zlim.lnx@...il.com, yang.shi@...aro.org,
holzheu@...ux.vnet.ibm.com, tgraf@...g.ch, netdev@...r.kernel.org,
Daniel Borkmann <daniel@...earbox.net>
Subject: [PATCH net-next 04/10] 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@...earbox.net>
Acked-by: Alexei Starovoitov <ast@...nel.org>
---
arch/arm64/net/bpf_jit_comp.c | 3 ---
arch/x86/net/bpf_jit_comp.c | 3 ---
2 files changed, 6 deletions(-)
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index a34420a..a7fb209 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -771,9 +771,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;
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 4286f36..f5bfd4f 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)
if (!bpf_jit_enable)
return;
- if (!prog || !prog->len)
- return;
-
addrs = kmalloc(prog->len * sizeof(*addrs), GFP_KERNEL);
if (!addrs)
return;
--
1.9.3
Powered by blists - more mailing lists