bpf, x86/arm64: remove useless checks on prog
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 13 May 2016 17:08:29 +0000 (19:08 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2016 17:49:32 +0000 (13:49 -0400)
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>
arch/arm64/net/bpf_jit_comp.c
arch/x86/net/bpf_jit_comp.c

index b405bbb544319e2a9a66ced51c12eaabb5621d25..ef35e866caf7100262b55c700898e024e0d53712 100644 (file)
@@ -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;
 
index 4286f3618bd07c32bba605874c4f9915be47820e..f5bfd4fd28dd37cae1b60933886a74729aa560d6 100644 (file)
@@ -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;