diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dst.c | 3 | ||||
-rw-r--r-- | net/core/neighbour.c | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/net/core/dst.c b/net/core/dst.c index 1a53fb39b7e0..f9eace78d354 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
@@ -132,10 +132,9 @@ void * dst_alloc(struct dst_ops * ops) | |||
132 | if (ops->gc()) | 132 | if (ops->gc()) |
133 | return NULL; | 133 | return NULL; |
134 | } | 134 | } |
135 | dst = kmem_cache_alloc(ops->kmem_cachep, GFP_ATOMIC); | 135 | dst = kmem_cache_zalloc(ops->kmem_cachep, GFP_ATOMIC); |
136 | if (!dst) | 136 | if (!dst) |
137 | return NULL; | 137 | return NULL; |
138 | memset(dst, 0, ops->entry_size); | ||
139 | atomic_set(&dst->__refcnt, 0); | 138 | atomic_set(&dst->__refcnt, 0); |
140 | dst->ops = ops; | 139 | dst->ops = ops; |
141 | dst->lastuse = jiffies; | 140 | dst->lastuse = jiffies; |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 054d46493d2b..efb673ad1854 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -251,12 +251,10 @@ static struct neighbour *neigh_alloc(struct neigh_table *tbl) | |||
251 | goto out_entries; | 251 | goto out_entries; |
252 | } | 252 | } |
253 | 253 | ||
254 | n = kmem_cache_alloc(tbl->kmem_cachep, GFP_ATOMIC); | 254 | n = kmem_cache_zalloc(tbl->kmem_cachep, GFP_ATOMIC); |
255 | if (!n) | 255 | if (!n) |
256 | goto out_entries; | 256 | goto out_entries; |
257 | 257 | ||
258 | memset(n, 0, tbl->entry_size); | ||
259 | |||
260 | skb_queue_head_init(&n->arp_queue); | 258 | skb_queue_head_init(&n->arp_queue); |
261 | rwlock_init(&n->lock); | 259 | rwlock_init(&n->lock); |
262 | n->updated = n->used = now; | 260 | n->updated = n->used = now; |