diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ipmr.c | 6 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_conn.c | 3 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_conntrack_core.c | 3 |
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) */ static struct mfc_cache *ipmr_cache_alloc(void) { - struct mfc_cache *c=kmem_cache_alloc(mrt_cachep, GFP_KERNEL); + struct mfc_cache *c=kmem_cache_zalloc(mrt_cachep, GFP_KERNEL); if(c==NULL) return NULL; - memset(c, 0, sizeof(*c)); c->mfc_un.res.minvif = MAXVIFS; return c; } static struct mfc_cache *ipmr_cache_alloc_unres(void) { - struct mfc_cache *c=kmem_cache_alloc(mrt_cachep, GFP_ATOMIC); + struct mfc_cache *c=kmem_cache_zalloc(mrt_cachep, GFP_ATOMIC); if(c==NULL) return NULL; - memset(c, 0, sizeof(*c)); skb_queue_head_init(&c->mfc_un.unres.unresolved); c->mfc_un.unres.expires = jiffies + 10*HZ; 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 struct ip_vs_conn *cp; struct ip_vs_protocol *pp = ip_vs_proto_get(proto); - cp = kmem_cache_alloc(ip_vs_conn_cachep, GFP_ATOMIC); + cp = kmem_cache_zalloc(ip_vs_conn_cachep, GFP_ATOMIC); if (cp == NULL) { IP_VS_ERR_RL("ip_vs_conn_new: no memory available.\n"); return NULL; } - memset(cp, 0, sizeof(*cp)); INIT_LIST_HEAD(&cp->c_list); init_timer(&cp->timer); 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, } } - conntrack = kmem_cache_alloc(ip_conntrack_cachep, GFP_ATOMIC); + conntrack = kmem_cache_zalloc(ip_conntrack_cachep, GFP_ATOMIC); if (!conntrack) { DEBUGP("Can't allocate conntrack.\n"); atomic_dec(&ip_conntrack_count); return ERR_PTR(-ENOMEM); } - memset(conntrack, 0, sizeof(*conntrack)); atomic_set(&conntrack->ct_general.use, 1); conntrack->ct_general.destroy = destroy_conntrack; conntrack->tuplehash[IP_CT_DIR_ORIGINAL].tuple = *orig; |