diff options
author | Vasiliy Kulikov <segooon@gmail.com> | 2010-10-26 14:21:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 16:52:06 -0700 |
commit | 0def08e3acc2c9c934e4671487029aed52202d42 (patch) | |
tree | 5c1259f85b0ab08cb3e421f6104bee832a956413 | |
parent | 74e3f3c3391d81a959f58a1191a560703a4415b4 (diff) | |
download | op-kernel-dev-0def08e3acc2c9c934e4671487029aed52202d42.zip op-kernel-dev-0def08e3acc2c9c934e4671487029aed52202d42.tar.gz |
mm/mempolicy.c: check return code of check_range
Function check_range may return ERR_PTR(...). Check for it.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Acked-by: David Rientjes <rientjes@google.com>
Reviewed-by: Christoph Lameter <cl@linux.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/mempolicy.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 21243b2..81a1276 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -924,12 +924,15 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest, nodemask_t nmask; LIST_HEAD(pagelist); int err = 0; + struct vm_area_struct *vma; nodes_clear(nmask); node_set(source, nmask); - check_range(mm, mm->mmap->vm_start, mm->task_size, &nmask, + vma = check_range(mm, mm->mmap->vm_start, mm->task_size, &nmask, flags | MPOL_MF_DISCONTIG_OK, &pagelist); + if (IS_ERR(vma)) + return PTR_ERR(vma); if (!list_empty(&pagelist)) { err = migrate_pages(&pagelist, new_node_page, dest, 0); |