summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmarchan@redhat.com <jmarchan@redhat.com>2014-01-15 16:27:11 +0100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-01-29 17:02:25 +1100
commit19751c07b3728748c1253627ce94e6906fa5e273 (patch)
tree5352397bce49d1c23e8df8fdd58db587a9edbae0
parent2c2e6ecfd077cbae72d32568af58c4ba57826c84 (diff)
downloadop-kernel-dev-19751c07b3728748c1253627ce94e6906fa5e273.zip
op-kernel-dev-19751c07b3728748c1253627ce94e6906fa5e273.tar.gz
powerpc/mm: Fix mmap errno when MAP_FIXED is set and mapping exceeds the allowed address space
According to Posix, if MAP_FIXED is specified mmap shall set ENOMEM if the requested mapping exceeds the allowed range for address space of the process. The generic code set it right, but the specific powerpc slice_get_unmapped_area() function currently returns -EINVAL in that case. This patch corrects it. Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/mm/slice.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index 7ce9cf3..b0c75cc 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -408,7 +408,7 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
if (fixed && (addr & ((1ul << pshift) - 1)))
return -EINVAL;
if (fixed && addr > (mm->task_size - len))
- return -EINVAL;
+ return -ENOMEM;
/* If hint, make sure it matches our alignment restrictions */
if (!fixed && addr) {
OpenPOWER on IntegriCloud