s390/bpf,jit: use kcalloc instead of kmalloc and memset

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>
This commit is contained in:
Stelian Nirlu 2013-03-11 18:22:10 +02:00 committed by Martin Schwidefsky
parent 040495d110
commit 3d04fea5e7

View 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));