Skip to content

Commit

Permalink
[IPV4] route.c: mostly kmalloc + memset conversion to k[cz]alloc
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 4487b2f commit 1bcabbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,16 @@ static int rt_cache_seq_open(struct inode *inode, struct file *file)
{
struct seq_file *seq;
int rc = -ENOMEM;
struct rt_cache_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
struct rt_cache_iter_state *s;

s = kzalloc(sizeof(*s), GFP_KERNEL);
if (!s)
goto out;
rc = seq_open(file, &rt_cache_seq_ops);
if (rc)
goto out_kfree;
seq = file->private_data;
seq->private = s;
memset(s, 0, sizeof(*s));
out:
return rc;
out_kfree:
Expand Down

0 comments on commit 1bcabbd

Please sign in to comment.