Skip to content

Commit

Permalink
net/ipv6/ip6mr.c: Use kmem_cache_zalloc, remove memset
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Joe Perches authored and David S. Miller committed Dec 4, 2008
1 parent df66f85 commit 36cbac5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/ipv6/ip6mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,20 +692,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;
Expand Down

0 comments on commit 36cbac5

Please sign in to comment.