aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 98bcb90d5957..50da9511aa77 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1311,8 +1311,10 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1311 while (!(page = follow_page(vma, start, foll_flags))) { 1311 while (!(page = follow_page(vma, start, foll_flags))) {
1312 int ret; 1312 int ret;
1313 1313
1314 /* FOLL_WRITE matches FAULT_FLAG_WRITE! */ 1314 ret = handle_mm_fault(mm, vma, start,
1315 ret = handle_mm_fault(mm, vma, start, foll_flags & FOLL_WRITE); 1315 (foll_flags & FOLL_WRITE) ?
1316 FAULT_FLAG_WRITE : 0);
1317
1316 if (ret & VM_FAULT_ERROR) { 1318 if (ret & VM_FAULT_ERROR) {
1317 if (ret & VM_FAULT_OOM) 1319 if (ret & VM_FAULT_OOM)
1318 return i ? i : -ENOMEM; 1320 return i ? i : -ENOMEM;