diff mbox

net/ipv6/ip6mr.c: Use kmem_cache_zalloc, remove memset

Message ID 1228343995.13046.34.camel@localhost
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Joe Perches Dec. 3, 2008, 10:39 p.m. UTC
Signed-off-by: Joe Perches <joe@perches.com>
---
 net/ipv6/ip6mr.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Dec. 4, 2008, 6:27 a.m. UTC | #1
From: Joe Perches <joe@perches.com>
Date: Wed, 03 Dec 2008 14:39:55 -0800

> Signed-off-by: Joe Perches <joe@perches.com>

Applied, thanks Joe.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index dfba9fd..f641eac 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -686,20 +686,18 @@  static struct mfc6_cache *ip6mr_cache_find(struct in6_addr *origin, struct in6_a
  */
 static struct mfc6_cache *ip6mr_cache_alloc(void)
 {
-	struct mfc6_cache *c = kmem_cache_alloc(mrt_cachep, GFP_KERNEL);
+	struct mfc6_cache *c = kmem_cache_zalloc(mrt_cachep, GFP_KERNEL);
 	if (c == NULL)
 		return NULL;
-	memset(c, 0, sizeof(*c));
 	c->mfc_un.res.minvif = MAXMIFS;
 	return c;
 }
 
 static struct mfc6_cache *ip6mr_cache_alloc_unres(void)
 {
-	struct mfc6_cache *c = kmem_cache_alloc(mrt_cachep, GFP_ATOMIC);
+	struct mfc6_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;