]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
s390/bpf: remove redundant check for non-null image
authorDaniel Borkmann <daniel@iogearbox.net>
Sat, 14 Jan 2017 00:48:24 +0000 (01:48 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 16 Jan 2017 06:27:55 +0000 (07:27 +0100)
After we already allocated the jit.prg_buf image via
bpf_jit_binary_alloc() and filled it out with instructions,
jit.prg_buf cannot be NULL anymore. Thus, remove the
unnecessary check. Tested on s390x with test_bpf module.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/net/bpf_jit_comp.c

index 167b31b186c1313c2cea094ee3b972233d61a608..b3b0af86b84ee9909f7fc0ef2c714a92e7e1a141 100644 (file)
@@ -1331,14 +1331,11 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
        }
        if (bpf_jit_enable > 1) {
                bpf_jit_dump(fp->len, jit.size, pass, jit.prg_buf);
-               if (jit.prg_buf)
-                       print_fn_code(jit.prg_buf, jit.size_prg);
-       }
-       if (jit.prg_buf) {
-               set_memory_ro((unsigned long)header, header->pages);
-               fp->bpf_func = (void *) jit.prg_buf;
-               fp->jited = 1;
+               print_fn_code(jit.prg_buf, jit.size_prg);
        }
+       set_memory_ro((unsigned long)header, header->pages);
+       fp->bpf_func = (void *) jit.prg_buf;
+       fp->jited = 1;
 free_addrs:
        kfree(jit.addrs);
 out: