s390/bpf,jit: use kcalloc instead of kmalloc and memset
authorStelian Nirlu <steliannirlu@gmail.com>
Mon, 11 Mar 2013 16:22:10 +0000 (18:22 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 17 Apr 2013 12:07:27 +0000 (14:07 +0200)
Signed-off-by: Stelian Nirlu <steliannirlu@gmail.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 0972e91cced229a5162cd893f871667b78b42760..82f165f8078c1b2fc209495bcc2847b2602e210d 100644 (file)
@@ -747,10 +747,9 @@ void bpf_jit_compile(struct sk_filter *fp)
 
        if (!bpf_jit_enable)
                return;
-       addrs = kmalloc(fp->len * sizeof(*addrs), GFP_KERNEL);
+       addrs = kcalloc(fp->len, sizeof(*addrs), GFP_KERNEL);
        if (addrs == NULL)
                return;
-       memset(addrs, 0, fp->len * sizeof(*addrs));
        memset(&jit, 0, sizeof(cjit));
        memset(&cjit, 0, sizeof(cjit));