linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / ipv6 / anycast.c
index f6881d7..840a33d 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <linux/capability.h>
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/types.h>
@@ -307,7 +308,7 @@ int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr)
         *      not found: create a new one.
         */
 
-       aca = kzalloc(sizeof(struct ifacaddr6), GFP_ATOMIC);
+       aca = kmalloc(sizeof(struct ifacaddr6), GFP_ATOMIC);
 
        if (aca == NULL) {
                err = -ENOMEM;
@@ -321,6 +322,8 @@ 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;
@@ -547,7 +550,7 @@ static int ac6_seq_open(struct inode *inode, struct file *file)
 {
        struct seq_file *seq;
        int rc = -ENOMEM;
-       struct ac6_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
+       struct ac6_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
 
        if (!s)
                goto out;
@@ -558,6 +561,7 @@ 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: