X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fipv6%2Fanycast.c;fp=net%2Fipv6%2Fanycast.c;h=840a33d3329696bfc5f9c2a67ca6e86b6336dca0;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=f6881d7a038599ee190c3dfcee85cb12b222d876;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index f6881d7a0..840a33d33 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -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: