mirror of
https://github.com/torvalds/linux.git
synced 2026-12-06 05:14:35 +00:00
mm/mempolicy.c: check return code of check_range
Function check_range may return ERR_PTR(...). Check for it. Signed-off-by: Vasiliy Kulikov <[email protected]> Acked-by: David Rientjes <[email protected]> Reviewed-by: Christoph Lameter <[email protected]> Reviewed-by: KOSAKI Motohiro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
committed by
Linus Torvalds
parent
74e3f3c339
commit
0def08e3ac
+4
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user