Commit b36eb52d authored by Haicheng Li's avatar Haicheng Li Committed by Greg Kroah-Hartman

slab: initialize unused alien cache entry as NULL at alloc_alien_cache().

commit f3186a9c upstream.

Comparing with existing code, it's a simpler way to use kzalloc_node()
to ensure that each unused alien cache entry is NULL.

CC: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
Acked-by: default avatarChristoph Lameter <cl@linux-foundation.org>
Acked-by: default avatarMatt Mackall <mpm@selenic.com>
Signed-off-by: default avatarHaicheng Li <haicheng.li@linux.intel.com>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7c0f2aed
...@@ -971,13 +971,11 @@ static struct array_cache **alloc_alien_cache(int node, int limit, gfp_t gfp) ...@@ -971,13 +971,11 @@ static struct array_cache **alloc_alien_cache(int node, int limit, gfp_t gfp)
if (limit > 1) if (limit > 1)
limit = 12; limit = 12;
ac_ptr = kmalloc_node(memsize, gfp, node); ac_ptr = kzalloc_node(memsize, gfp, node);
if (ac_ptr) { if (ac_ptr) {
for_each_node(i) { for_each_node(i) {
if (i == node || !node_online(i)) { if (i == node || !node_online(i))
ac_ptr[i] = NULL;
continue; continue;
}
ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp); ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp);
if (!ac_ptr[i]) { if (!ac_ptr[i]) {
for (i--; i >= 0; i--) for (i--; i >= 0; i--)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment