diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/mm/memory.c b/mm/memory.c index 450127f4c582..b8487f8cd82e 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -2819,19 +2819,9 @@ int make_pages_present(unsigned long addr, unsigned long end) | |||
2819 | len = DIV_ROUND_UP(end, PAGE_SIZE) - addr/PAGE_SIZE; | 2819 | len = DIV_ROUND_UP(end, PAGE_SIZE) - addr/PAGE_SIZE; |
2820 | ret = get_user_pages(current, current->mm, addr, | 2820 | ret = get_user_pages(current, current->mm, addr, |
2821 | len, write, 0, NULL, NULL); | 2821 | len, write, 0, NULL, NULL); |
2822 | if (ret < 0) { | 2822 | if (ret < 0) |
2823 | /* | ||
2824 | SUS require strange return value to mlock | ||
2825 | - invalid addr generate to ENOMEM. | ||
2826 | - out of memory should generate EAGAIN. | ||
2827 | */ | ||
2828 | if (ret == -EFAULT) | ||
2829 | ret = -ENOMEM; | ||
2830 | else if (ret == -ENOMEM) | ||
2831 | ret = -EAGAIN; | ||
2832 | return ret; | 2823 | return ret; |
2833 | } | 2824 | return ret == len ? 0 : -1; |
2834 | return ret == len ? 0 : -ENOMEM; | ||
2835 | } | 2825 | } |
2836 | 2826 | ||
2837 | #if !defined(__HAVE_ARCH_GATE_AREA) | 2827 | #if !defined(__HAVE_ARCH_GATE_AREA) |