aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ipmr.c6
-rw-r--r--net/ipv4/ipvs/ip_vs_conn.c3
-rw-r--r--net/ipv4/netfilter/ip_conntrack_core.c3
3 files changed, 4 insertions, 8 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index ecb5422ea237..d7e1e60f51d5 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -479,20 +479,18 @@ static struct mfc_cache *ipmr_cache_find(__be32 origin, __be32 mcastgrp)
479 */ 479 */
480static struct mfc_cache *ipmr_cache_alloc(void) 480static struct mfc_cache *ipmr_cache_alloc(void)
481{ 481{
482 struct mfc_cache *c=kmem_cache_alloc(mrt_cachep, GFP_KERNEL); 482 struct mfc_cache *c=kmem_cache_zalloc(mrt_cachep, GFP_KERNEL);
483 if(c==NULL) 483 if(c==NULL)
484 return NULL; 484 return NULL;
485 memset(c, 0, sizeof(*c));
486 c->mfc_un.res.minvif = MAXVIFS; 485 c->mfc_un.res.minvif = MAXVIFS;
487 return c; 486 return c;
488} 487}
489 488
490static struct mfc_cache *ipmr_cache_alloc_unres(void) 489static struct mfc_cache *ipmr_cache_alloc_unres(void)
491{ 490{
492 struct mfc_cache *c=kmem_cache_alloc(mrt_cachep, GFP_ATOMIC); 491 struct mfc_cache *c=kmem_cache_zalloc(mrt_cachep, GFP_ATOMIC);
493 if(c==NULL) 492 if(c==NULL)
494 return NULL; 493 return NULL;
495 memset(c, 0, sizeof(*c));
496 skb_queue_head_init(&c->mfc_un.unres.unresolved); 494 skb_queue_head_init(&c->mfc_un.unres.unresolved);
497 c->mfc_un.unres.expires = jiffies + 10*HZ; 495 c->mfc_un.unres.expires = jiffies + 10*HZ;
498 return c; 496 return c;
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index 8086787a2c51..3aec4ac66e3c 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -603,13 +603,12 @@ ip_vs_conn_new(int proto, __be32 caddr, __be16 cport, __be32 vaddr, __be16 vport
603 struct ip_vs_conn *cp; 603 struct ip_vs_conn *cp;
604 struct ip_vs_protocol *pp = ip_vs_proto_get(proto); 604 struct ip_vs_protocol *pp = ip_vs_proto_get(proto);
605 605
606 cp = kmem_cache_alloc(ip_vs_conn_cachep, GFP_ATOMIC); 606 cp = kmem_cache_zalloc(ip_vs_conn_cachep, GFP_ATOMIC);
607 if (cp == NULL) { 607 if (cp == NULL) {
608 IP_VS_ERR_RL("ip_vs_conn_new: no memory available.\n"); 608 IP_VS_ERR_RL("ip_vs_conn_new: no memory available.\n");
609 return NULL; 609 return NULL;
610 } 610 }
611 611
612 memset(cp, 0, sizeof(*cp));
613 INIT_LIST_HEAD(&cp->c_list); 612 INIT_LIST_HEAD(&cp->c_list);
614 init_timer(&cp->timer); 613 init_timer(&cp->timer);
615 cp->timer.data = (unsigned long)cp; 614 cp->timer.data = (unsigned long)cp;
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
index 8556a4f4f60a..62be2eb37698 100644
--- a/net/ipv4/netfilter/ip_conntrack_core.c
+++ b/net/ipv4/netfilter/ip_conntrack_core.c
@@ -638,14 +638,13 @@ struct ip_conntrack *ip_conntrack_alloc(struct ip_conntrack_tuple *orig,
638 } 638 }
639 } 639 }
640 640
641 conntrack = kmem_cache_alloc(ip_conntrack_cachep, GFP_ATOMIC); 641 conntrack = kmem_cache_zalloc(ip_conntrack_cachep, GFP_ATOMIC);
642 if (!conntrack) { 642 if (!conntrack) {
643 DEBUGP("Can't allocate conntrack.\n"); 643 DEBUGP("Can't allocate conntrack.\n");
644 atomic_dec(&ip_conntrack_count); 644 atomic_dec(&ip_conntrack_count);
645 return ERR_PTR(-ENOMEM); 645 return ERR_PTR(-ENOMEM);
646 } 646 }
647 647
648 memset(conntrack, 0, sizeof(*conntrack));
649 atomic_set(&conntrack->ct_general.use, 1); 648 atomic_set(&conntrack->ct_general.use, 1);
650 conntrack->ct_general.destroy = destroy_conntrack; 649 conntrack->ct_general.destroy = destroy_conntrack;
651 conntrack->tuplehash[IP_CT_DIR_ORIGINAL].tuple = *orig; 650 conntrack->tuplehash[IP_CT_DIR_ORIGINAL].tuple = *orig;