Commit f3186a9c authored by Haicheng Li's avatar Haicheng Li Committed by Pekka Enberg
Browse files

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

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 <>
Acked-by: default avatarAndi Kleen <>
Acked-by: default avatarChristoph Lameter <>
Acked-by: default avatarMatt Mackall <>
Signed-off-by: default avatarHaicheng Li <>
Signed-off-by: default avatarPekka Enberg <>
parent 6b7b2849
......@@ -983,13 +983,11 @@ static struct array_cache **alloc_alien_cache(int node, int limit, gfp_t gfp)
if (limit > 1)
limit = 12;
ac_ptr = kmalloc_node(memsize, gfp, node);
ac_ptr = kzalloc_node(memsize, gfp, node);
if (ac_ptr) {
for_each_node(i) {
if (i == node || !node_online(i)) {
ac_ptr[i] = NULL;
if (i == node || !node_online(i))
ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp);
if (!ac_ptr[i]) {
for (i--; i >= 0; i--)
Supports Markdown
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