]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.10/slab-initialize-unused-alien-cache-entry-as-null-at-alloc_alien_cache.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.10 / slab-initialize-unused-alien-cache-entry-as-null-at-alloc_alien_cache.patch
CommitLineData
cb8b711e
GKH
1From f3186a9c51eabe75b2780153ed7f07778d78b16e Mon Sep 17 00:00:00 2001
2From: Haicheng Li <haicheng.li@linux.intel.com>
3Date: Wed, 6 Jan 2010 15:25:23 +0800
4Subject: slab: initialize unused alien cache entry as NULL at alloc_alien_cache().
5
6From: Haicheng Li <haicheng.li@linux.intel.com>
7
8commit f3186a9c51eabe75b2780153ed7f07778d78b16e upstream.
9
10Comparing with existing code, it's a simpler way to use kzalloc_node()
11to ensure that each unused alien cache entry is NULL.
12
13CC: Eric Dumazet <eric.dumazet@gmail.com>
14Acked-by: Andi Kleen <ak@linux.intel.com>
15Acked-by: Christoph Lameter <cl@linux-foundation.org>
16Acked-by: Matt Mackall <mpm@selenic.com>
17Signed-off-by: Haicheng Li <haicheng.li@linux.intel.com>
18Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
19Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20
21---
22 mm/slab.c | 6 ++----
23 1 file changed, 2 insertions(+), 4 deletions(-)
24
25--- a/mm/slab.c
26+++ b/mm/slab.c
27@@ -971,13 +971,11 @@ static struct array_cache **alloc_alien_
28
29 if (limit > 1)
30 limit = 12;
31- ac_ptr = kmalloc_node(memsize, gfp, node);
32+ ac_ptr = kzalloc_node(memsize, gfp, node);
33 if (ac_ptr) {
34 for_each_node(i) {
35- if (i == node || !node_online(i)) {
36- ac_ptr[i] = NULL;
37+ if (i == node || !node_online(i))
38 continue;
39- }
40 ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp);
41 if (!ac_ptr[i]) {
42 for (i--; i >= 0; i--)