mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 13:51:44 +00:00
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:
parent
040495d110
commit
3d04fea5e7
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user