Skip to content

Commit

Permalink
s390/bpf,jit: use kcalloc instead of kmalloc and memset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stelian Nirlu authored and Martin Schwidefsky committed Apr 17, 2013
1 parent 040495d commit 3d04fea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/s390/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 3d04fea

Please sign in to comment.