]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.36.2/numa-fix-slab_node-mpol_bind.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / numa-fix-slab_node-mpol_bind.patch
CommitLineData
9f934a63
GKH
1From 800416f799e0723635ac2d720ad4449917a1481c Mon Sep 17 00:00:00 2001
2From: Eric Dumazet <eric.dumazet@gmail.com>
3Date: Wed, 27 Oct 2010 19:33:43 +0200
4Subject: numa: fix slab_node(MPOL_BIND)
5
6From: Eric Dumazet <eric.dumazet@gmail.com>
7
8commit 800416f799e0723635ac2d720ad4449917a1481c upstream.
9
10When a node contains only HighMem memory, slab_node(MPOL_BIND)
11dereferences 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
17Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
18Cc: Mel Gorman <mel@csn.ul.ie>
19Cc: Christoph Lameter <cl@linux.com>
20Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
21Cc: Andrew Morton <akpm@linux-foundation.org>
22Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
23Signed-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: