]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.36.2/numa-fix-slab_node-mpol_bind.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / numa-fix-slab_node-mpol_bind.patch
1 From 800416f799e0723635ac2d720ad4449917a1481c Mon Sep 17 00:00:00 2001
2 From: Eric Dumazet <eric.dumazet@gmail.com>
3 Date: Wed, 27 Oct 2010 19:33:43 +0200
4 Subject: numa: fix slab_node(MPOL_BIND)
5
6 From: Eric Dumazet <eric.dumazet@gmail.com>
7
8 commit 800416f799e0723635ac2d720ad4449917a1481c upstream.
9
10 When a node contains only HighMem memory, slab_node(MPOL_BIND)
11 dereferences a NULL pointer.
12
13 [ This code seems to go back all the way to commit 19770b32609b: "mm:
14 filter based on a nodemask as well as a gfp_mask". Which was back in
15 April 2008, and it got merged into 2.6.26. - Linus ]
16
17 Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
18 Cc: Mel Gorman <mel@csn.ul.ie>
19 Cc: Christoph Lameter <cl@linux.com>
20 Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
21 Cc: Andrew Morton <akpm@linux-foundation.org>
22 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
24
25 ---
26 mm/mempolicy.c | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
29 --- a/mm/mempolicy.c
30 +++ b/mm/mempolicy.c
31 @@ -1588,7 +1588,7 @@ unsigned slab_node(struct mempolicy *pol
32 (void)first_zones_zonelist(zonelist, highest_zoneidx,
33 &policy->v.nodes,
34 &zone);
35 - return zone->node;
36 + return zone ? zone->node : numa_node_id();
37 }
38
39 default: