aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv6/ah6.c4
-rw-r--r--net/ipv6/anycast.c7
-rw-r--r--net/ipv6/esp6.c4
-rw-r--r--net/ipv6/ip6_flowlabel.c6
-rw-r--r--net/ipv6/ipcomp6.c3
-rw-r--r--net/ipv6/mcast.c17
-rw-r--r--net/ipv6/raw.c3
-rw-r--r--net/ipv6/route.c3
8 files changed, 16 insertions, 31 deletions
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 2b55b9a97aea..cf58251df4b3 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -354,12 +354,10 @@ static int ah6_init_state(struct xfrm_state *x)
354 if (x->encap) 354 if (x->encap)
355 goto error; 355 goto error;
356 356
357 ahp = kmalloc(sizeof(*ahp), GFP_KERNEL); 357 ahp = kzalloc(sizeof(*ahp), GFP_KERNEL);
358 if (ahp == NULL) 358 if (ahp == NULL)
359 return -ENOMEM; 359 return -ENOMEM;
360 360
361 memset(ahp, 0, sizeof(*ahp));
362
363 ahp->key = x->aalg->alg_key; 361 ahp->key = x->aalg->alg_key;
364 ahp->key_len = (x->aalg->alg_key_len+7)/8; 362 ahp->key_len = (x->aalg->alg_key_len+7)/8;
365 ahp->tfm = crypto_alloc_tfm(x->aalg->alg_name, 0); 363 ahp->tfm = crypto_alloc_tfm(x->aalg->alg_name, 0);
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));
565out: 562out:
566 return rc; 563 return rc;
567out_kfree: 564out_kfree:
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index aa7f100dab35..3dcaac7a0972 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -305,12 +305,10 @@ static int esp6_init_state(struct xfrm_state *x)
305 if (x->encap) 305 if (x->encap)
306 goto error; 306 goto error;
307 307
308 esp = kmalloc(sizeof(*esp), GFP_KERNEL); 308 esp = kzalloc(sizeof(*esp), GFP_KERNEL);
309 if (esp == NULL) 309 if (esp == NULL)
310 return -ENOMEM; 310 return -ENOMEM;
311 311
312 memset(esp, 0, sizeof(*esp));
313
314 if (x->aalg) { 312 if (x->aalg) {
315 struct xfrm_algo_desc *aalg_desc; 313 struct xfrm_algo_desc *aalg_desc;
316 314
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 69cbe8a66d02..f9ca63912fbf 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -287,10 +287,9 @@ fl_create(struct in6_flowlabel_req *freq, char __user *optval, int optlen, int *
287 int err; 287 int err;
288 288
289 err = -ENOMEM; 289 err = -ENOMEM;
290 fl = kmalloc(sizeof(*fl), GFP_KERNEL); 290 fl = kzalloc(sizeof(*fl), GFP_KERNEL);
291 if (fl == NULL) 291 if (fl == NULL)
292 goto done; 292 goto done;
293 memset(fl, 0, sizeof(*fl));
294 293
295 olen = optlen - CMSG_ALIGN(sizeof(*freq)); 294 olen = optlen - CMSG_ALIGN(sizeof(*freq));
296 if (olen > 0) { 295 if (olen > 0) {
@@ -663,7 +662,7 @@ static int ip6fl_seq_open(struct inode *inode, struct file *file)
663{ 662{
664 struct seq_file *seq; 663 struct seq_file *seq;
665 int rc = -ENOMEM; 664 int rc = -ENOMEM;
666 struct ip6fl_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 665 struct ip6fl_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
667 666
668 if (!s) 667 if (!s)
669 goto out; 668 goto out;
@@ -674,7 +673,6 @@ static int ip6fl_seq_open(struct inode *inode, struct file *file)
674 673
675 seq = file->private_data; 674 seq = file->private_data;
676 seq->private = s; 675 seq->private = s;
677 memset(s, 0, sizeof(*s));
678out: 676out:
679 return rc; 677 return rc;
680out_kfree: 678out_kfree:
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 3c7b324cd20c..028b636687ec 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -428,11 +428,10 @@ static int ipcomp6_init_state(struct xfrm_state *x)
428 goto out; 428 goto out;
429 429
430 err = -ENOMEM; 430 err = -ENOMEM;
431 ipcd = kmalloc(sizeof(*ipcd), GFP_KERNEL); 431 ipcd = kzalloc(sizeof(*ipcd), GFP_KERNEL);
432 if (!ipcd) 432 if (!ipcd)
433 goto out; 433 goto out;
434 434
435 memset(ipcd, 0, sizeof(*ipcd));
436 x->props.header_len = 0; 435 x->props.header_len = 0;
437 if (x->props.mode) 436 if (x->props.mode)
438 x->props.header_len += sizeof(struct ipv6hdr); 437 x->props.header_len += sizeof(struct ipv6hdr);
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 807c021d64a2..6e871afbb2c7 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -767,10 +767,10 @@ static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im)
767 * for deleted items allows change reports to use common code with 767 * for deleted items allows change reports to use common code with
768 * non-deleted or query-response MCA's. 768 * non-deleted or query-response MCA's.
769 */ 769 */
770 pmc = kmalloc(sizeof(*pmc), GFP_ATOMIC); 770 pmc = kzalloc(sizeof(*pmc), GFP_ATOMIC);
771 if (!pmc) 771 if (!pmc)
772 return; 772 return;
773 memset(pmc, 0, sizeof(*pmc)); 773
774 spin_lock_bh(&im->mca_lock); 774 spin_lock_bh(&im->mca_lock);
775 spin_lock_init(&pmc->mca_lock); 775 spin_lock_init(&pmc->mca_lock);
776 pmc->idev = im->idev; 776 pmc->idev = im->idev;
@@ -893,7 +893,7 @@ int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr)
893 * not found: create a new one. 893 * not found: create a new one.
894 */ 894 */
895 895
896 mc = kmalloc(sizeof(struct ifmcaddr6), GFP_ATOMIC); 896 mc = kzalloc(sizeof(struct ifmcaddr6), GFP_ATOMIC);
897 897
898 if (mc == NULL) { 898 if (mc == NULL) {
899 write_unlock_bh(&idev->lock); 899 write_unlock_bh(&idev->lock);
@@ -901,7 +901,6 @@ int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr)
901 return -ENOMEM; 901 return -ENOMEM;
902 } 902 }
903 903
904 memset(mc, 0, sizeof(struct ifmcaddr6));
905 init_timer(&mc->mca_timer); 904 init_timer(&mc->mca_timer);
906 mc->mca_timer.function = igmp6_timer_handler; 905 mc->mca_timer.function = igmp6_timer_handler;
907 mc->mca_timer.data = (unsigned long) mc; 906 mc->mca_timer.data = (unsigned long) mc;
@@ -1934,10 +1933,10 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode,
1934 psf_prev = psf; 1933 psf_prev = psf;
1935 } 1934 }
1936 if (!psf) { 1935 if (!psf) {
1937 psf = kmalloc(sizeof(*psf), GFP_ATOMIC); 1936 psf = kzalloc(sizeof(*psf), GFP_ATOMIC);
1938 if (!psf) 1937 if (!psf)
1939 return -ENOBUFS; 1938 return -ENOBUFS;
1940 memset(psf, 0, sizeof(*psf)); 1939
1941 psf->sf_addr = *psfsrc; 1940 psf->sf_addr = *psfsrc;
1942 if (psf_prev) { 1941 if (psf_prev) {
1943 psf_prev->sf_next = psf; 1942 psf_prev->sf_next = psf;
@@ -2431,7 +2430,7 @@ static int igmp6_mc_seq_open(struct inode *inode, struct file *file)
2431{ 2430{
2432 struct seq_file *seq; 2431 struct seq_file *seq;
2433 int rc = -ENOMEM; 2432 int rc = -ENOMEM;
2434 struct igmp6_mc_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 2433 struct igmp6_mc_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
2435 2434
2436 if (!s) 2435 if (!s)
2437 goto out; 2436 goto out;
@@ -2442,7 +2441,6 @@ static int igmp6_mc_seq_open(struct inode *inode, struct file *file)
2442 2441
2443 seq = file->private_data; 2442 seq = file->private_data;
2444 seq->private = s; 2443 seq->private = s;
2445 memset(s, 0, sizeof(*s));
2446out: 2444out:
2447 return rc; 2445 return rc;
2448out_kfree: 2446out_kfree:
@@ -2606,7 +2604,7 @@ static int igmp6_mcf_seq_open(struct inode *inode, struct file *file)
2606{ 2604{
2607 struct seq_file *seq; 2605 struct seq_file *seq;
2608 int rc = -ENOMEM; 2606 int rc = -ENOMEM;
2609 struct igmp6_mcf_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 2607 struct igmp6_mcf_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
2610 2608
2611 if (!s) 2609 if (!s)
2612 goto out; 2610 goto out;
@@ -2617,7 +2615,6 @@ static int igmp6_mcf_seq_open(struct inode *inode, struct file *file)
2617 2615
2618 seq = file->private_data; 2616 seq = file->private_data;
2619 seq->private = s; 2617 seq->private = s;
2620 memset(s, 0, sizeof(*s));
2621out: 2618out:
2622 return rc; 2619 return rc;
2623out_kfree: 2620out_kfree:
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 0f63078af41f..fa1ce0ae123e 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -1198,7 +1198,7 @@ static int raw6_seq_open(struct inode *inode, struct file *file)
1198{ 1198{
1199 struct seq_file *seq; 1199 struct seq_file *seq;
1200 int rc = -ENOMEM; 1200 int rc = -ENOMEM;
1201 struct raw6_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 1201 struct raw6_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
1202 if (!s) 1202 if (!s)
1203 goto out; 1203 goto out;
1204 rc = seq_open(file, &raw6_seq_ops); 1204 rc = seq_open(file, &raw6_seq_ops);
@@ -1206,7 +1206,6 @@ static int raw6_seq_open(struct inode *inode, struct file *file)
1206 goto out_kfree; 1206 goto out_kfree;
1207 seq = file->private_data; 1207 seq = file->private_data;
1208 seq->private = s; 1208 seq->private = s;
1209 memset(s, 0, sizeof(*s));
1210out: 1209out:
1211 return rc; 1210 return rc;
1212out_kfree: 1211out_kfree:
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index e16c9825c4dc..79078747a646 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1877,11 +1877,10 @@ int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
1877 /* 1877 /*
1878 * 2. allocate and initialize walker. 1878 * 2. allocate and initialize walker.
1879 */ 1879 */
1880 w = kmalloc(sizeof(*w), GFP_ATOMIC); 1880 w = kzalloc(sizeof(*w), GFP_ATOMIC);
1881 if (w == NULL) 1881 if (w == NULL)
1882 return -ENOMEM; 1882 return -ENOMEM;
1883 RT6_TRACE("dump<%p", w); 1883 RT6_TRACE("dump<%p", w);
1884 memset(w, 0, sizeof(*w));
1885 w->root = &ip6_routing_table; 1884 w->root = &ip6_routing_table;
1886 w->func = fib6_dump_node; 1885 w->func = fib6_dump_node;
1887 w->args = &arg; 1886 w->args = &arg;