[IPV6]: Nearly complete kzalloc cleanup for net/ipv6
Stupidly use kzalloc() instead of kmalloc()/memset() everywhere where this is possible in net/ipv6/*.c . Signed-off-by: Ingo Oeser <ioe-lkml@rameria.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
78c784c47a
commit
0c600eda4b
@@ -308,7 +308,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr)
|
||||
* not found: create a new one.
|
||||
*/
|
||||
|
||||
aca = kmalloc(sizeof(struct ifacaddr6), GFP_ATOMIC);
|
||||
aca = kzalloc(sizeof(struct ifacaddr6), GFP_ATOMIC);
|
||||
|
||||
if (aca == NULL) {
|
||||
err = -ENOMEM;
|
||||
@@ -322,8 +322,6 @@ int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr)
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset(aca, 0, sizeof(struct ifacaddr6));
|
||||
|
||||
ipv6_addr_copy(&aca->aca_addr, addr);
|
||||
aca->aca_idev = idev;
|
||||
aca->aca_rt = rt;
|
||||
@@ -550,7 +548,7 @@ static int ac6_seq_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct seq_file *seq;
|
||||
int rc = -ENOMEM;
|
||||
struct ac6_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
|
||||
struct ac6_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
|
||||
|
||||
if (!s)
|
||||
goto out;
|
||||
@@ -561,7 +559,6 @@ static int ac6_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:
|
||||
|
Reference in New Issue
Block a user