Commit 8adc5465 authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by David S. Miller

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

Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9f0d1a00
...@@ -294,15 +294,14 @@ static int exp_open(struct inode *inode, struct file *file) ...@@ -294,15 +294,14 @@ static int exp_open(struct inode *inode, struct file *file)
struct ct_expect_iter_state *st; struct ct_expect_iter_state *st;
int ret; int ret;
st = kmalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL); st = kzalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL);
if (st == NULL) if (!st)
return -ENOMEM; return -ENOMEM;
ret = seq_open(file, &exp_seq_ops); ret = seq_open(file, &exp_seq_ops);
if (ret) if (ret)
goto out_free; goto out_free;
seq = file->private_data; seq = file->private_data;
seq->private = st; seq->private = st;
memset(st, 0, sizeof(struct ct_expect_iter_state));
return ret; return ret;
out_free: out_free:
kfree(st); kfree(st);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment