提交 3d04fea5 编写于 作者: S Stelian Nirlu 提交者: Martin Schwidefsky

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

Signed-off-by: NStelian Nirlu <steliannirlu@gmail.com>
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 040495d1
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册