提交 9f0d1a00 编写于 作者: M Mariusz Kozlowski 提交者: David S. Miller

[NETFILTER] nf_conntrack_expect.c: kmalloc + memset conversion to kzalloc

Signed-off-by: NMariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2f081235
......@@ -477,15 +477,14 @@ static int exp_open(struct inode *inode, struct file *file)
struct ct_expect_iter_state *st;
int ret;
st = kmalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL);
if (st == NULL)
st = kzalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL);
if (!st)
return -ENOMEM;
ret = seq_open(file, &exp_seq_ops);
if (ret)
goto out_free;
seq = file->private_data;
seq->private = st;
memset(st, 0, sizeof(struct ct_expect_iter_state));
return ret;
out_free:
kfree(st);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册