aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorHillf Danton <dhillf@gmail.com>2013-03-08 15:43:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 18:05:34 -0500
commit5ca3957510b9fc2a14d3647db518014842f9a2b4 (patch)
tree6a4427c2e58796ced91b079733e94431b0e7c8b7 /mm
parent88b9e456b1649722673ffa147914299799dc9041 (diff)
mm/mempolicy.c: fix wrong sp_node insertion
n->end is accessed in sp_insert(). Thus it should be update before calling sp_insert(). This mistake may make kernel panic. Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Hugh Dickins <hughd@google.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Dave Jones <davej@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 31d26637b658..868d08f49f07 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2391,8 +2391,8 @@ restart:
2391 *mpol_new = *n->policy; 2391 *mpol_new = *n->policy;
2392 atomic_set(&mpol_new->refcnt, 1); 2392 atomic_set(&mpol_new->refcnt, 1);
2393 sp_node_init(n_new, n->end, end, mpol_new); 2393 sp_node_init(n_new, n->end, end, mpol_new);
2394 sp_insert(sp, n_new);
2395 n->end = start; 2394 n->end = start;
2395 sp_insert(sp, n_new);
2396 n_new = NULL; 2396 n_new = NULL;
2397 mpol_new = NULL; 2397 mpol_new = NULL;
2398 break; 2398 break;