From: Haicheng Li Date: Wed, 6 Jan 2010 07:25:23 +0000 (+0800) Subject: slab: initialize unused alien cache entry as NULL at alloc_alien_cache(). X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f3186a9c51eabe75b2780153ed7f07778d78b16e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Andi Kleen Acked-by: Christoph Lameter Acked-by: Matt Mackall Signed-off-by: Haicheng Li Signed-off-by: Pekka Enberg --- diff --git a/mm/slab.c b/mm/slab.c index 7d41f15b48d3..0c632a946ea1 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -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)) continue; - } ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp); if (!ac_ptr[i]) { for (i--; i >= 0; i--)