Skip to content

Commit

Permalink
[IPV4] raw.c: kmalloc + memset conversion to kzalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Mariusz Kozlowski authored and David S. Miller committed Aug 3, 2007
1 parent 8adc546 commit 4487b2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,9 @@ static int raw_seq_open(struct inode *inode, struct file *file)
{
struct seq_file *seq;
int rc = -ENOMEM;
struct raw_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
struct raw_iter_state *s;

s = kzalloc(sizeof(*s), GFP_KERNEL);
if (!s)
goto out;
rc = seq_open(file, &raw_seq_ops);
Expand All @@ -910,7 +911,6 @@ static int raw_seq_open(struct inode *inode, struct file *file)

seq = file->private_data;
seq->private = s;
memset(s, 0, sizeof(*s));
out:
return rc;
out_kfree:
Expand Down

0 comments on commit 4487b2f

Please sign in to comment.