diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c index 806a37ec71bd..346ee7e041fd 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -1576,9 +1576,16 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | |||
1576 | if (ret & VM_FAULT_ERROR) { | 1576 | if (ret & VM_FAULT_ERROR) { |
1577 | if (ret & VM_FAULT_OOM) | 1577 | if (ret & VM_FAULT_OOM) |
1578 | return i ? i : -ENOMEM; | 1578 | return i ? i : -ENOMEM; |
1579 | if (ret & | 1579 | if (ret & (VM_FAULT_HWPOISON | |
1580 | (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE| | 1580 | VM_FAULT_HWPOISON_LARGE)) { |
1581 | VM_FAULT_SIGBUS)) | 1581 | if (i) |
1582 | return i; | ||
1583 | else if (gup_flags & FOLL_HWPOISON) | ||
1584 | return -EHWPOISON; | ||
1585 | else | ||
1586 | return -EFAULT; | ||
1587 | } | ||
1588 | if (ret & VM_FAULT_SIGBUS) | ||
1582 | return i ? i : -EFAULT; | 1589 | return i ? i : -EFAULT; |
1583 | BUG(); | 1590 | BUG(); |
1584 | } | 1591 | } |