diff options
author | Ingo Oeser <ioe-lkml@rameria.de> | 2006-03-21 02:01:32 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 02:01:32 -0500 |
commit | 0c600eda4b1c9f8f6d1bd643d494db5a29842fbe (patch) | |
tree | 3340fda7a4f9f481e7f91ed1f376c7b4bd5e9a6e /net/ipv6/anycast.c | |
parent | 78c784c47a2be593480cb6c69829a59f0504d575 (diff) |
[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>
Diffstat (limited to 'net/ipv6/anycast.c')
-rw-r--r-- | net/ipv6/anycast.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index 840a33d33296..39ec528923f6 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c | |||
@@ -308,7 +308,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr) | |||
308 | * not found: create a new one. | 308 | * not found: create a new one. |
309 | */ | 309 | */ |
310 | 310 | ||
311 | aca = kmalloc(sizeof(struct ifacaddr6), GFP_ATOMIC); | 311 | aca = kzalloc(sizeof(struct ifacaddr6), GFP_ATOMIC); |
312 | 312 | ||
313 | if (aca == NULL) { | 313 | if (aca == NULL) { |
314 | err = -ENOMEM; | 314 | err = -ENOMEM; |
@@ -322,8 +322,6 @@ int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr) | |||
322 | goto out; | 322 | goto out; |
323 | } | 323 | } |
324 | 324 | ||
325 | memset(aca, 0, sizeof(struct ifacaddr6)); | ||
326 | |||
327 | ipv6_addr_copy(&aca->aca_addr, addr); | 325 | ipv6_addr_copy(&aca->aca_addr, addr); |
328 | aca->aca_idev = idev; | 326 | aca->aca_idev = idev; |
329 | aca->aca_rt = rt; | 327 | aca->aca_rt = rt; |
@@ -550,7 +548,7 @@ static int ac6_seq_open(struct inode *inode, struct file *file) | |||
550 | { | 548 | { |
551 | struct seq_file *seq; | 549 | struct seq_file *seq; |
552 | int rc = -ENOMEM; | 550 | int rc = -ENOMEM; |
553 | struct ac6_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); | 551 | struct ac6_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL); |
554 | 552 | ||
555 | if (!s) | 553 | if (!s) |
556 | goto out; | 554 | goto out; |
@@ -561,7 +559,6 @@ static int ac6_seq_open(struct inode *inode, struct file *file) | |||
561 | 559 | ||
562 | seq = file->private_data; | 560 | seq = file->private_data; |
563 | seq->private = s; | 561 | seq->private = s; |
564 | memset(s, 0, sizeof(*s)); | ||
565 | out: | 562 | out: |
566 | return rc; | 563 | return rc; |
567 | out_kfree: | 564 | out_kfree: |