Move check for TASK_SIZE before MAP_FIXED in arm's arch_get_unmapped_area(). Signed-off-by: Vladimir Murzin <murzin.v@xxxxxxxxx> --- arch/arm/mm/mmap.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index ce8cb19..288cc5f 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c @@ -80,6 +80,9 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, if (aliasing) do_align = filp || (flags & MAP_SHARED); + if (len > TASK_SIZE) + return -ENOMEM; + /* * We enforce the MAP_FIXED case. */ @@ -90,9 +93,6 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, return addr; } - if (len > TASK_SIZE) - return -ENOMEM; - if (addr) { if (do_align) addr = COLOUR_ALIGN(addr, pgoff); -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html