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:
Родитель
040495d110
Коммит
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));
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче