aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r--mm/mempolicy.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index cfb6c8678754..b19569137529 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1361,11 +1361,14 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
1361 1361
1362 mm = get_task_mm(task); 1362 mm = get_task_mm(task);
1363 put_task_struct(task); 1363 put_task_struct(task);
1364 if (mm) 1364
1365 err = do_migrate_pages(mm, old, new, 1365 if (!mm) {
1366 capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE);
1367 else
1368 err = -EINVAL; 1366 err = -EINVAL;
1367 goto out;
1368 }
1369
1370 err = do_migrate_pages(mm, old, new,
1371 capable(CAP_SYS_NICE) ? MPOL_MF_MOVE_ALL : MPOL_MF_MOVE);
1369 1372
1370 mmput(mm); 1373 mmput(mm);
1371out: 1374out: