]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix return value after hugetlb mmap failure
authorAnton Blanchard <anton@samba.org>
Mon, 30 Jun 2003 11:02:53 +0000 (04:02 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 30 Jun 2003 11:02:53 +0000 (04:02 -0700)
At the moment no one uses is_aligned_hugepage_range or is_hugepage_only_range,
but it is reasonable to assume they return true or false.

On error we want to return -EINVAL back to userspace.

mm/mmap.c

index 09fc4cafe533b0edde1875eafc44c0041822b988..c83cf2a8b12680ff083225103bb81b146f2f55af 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -846,7 +846,7 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
                        ret = is_hugepage_only_range(addr, len);
                }
                if (ret)
-                       return ret;
+                       return -EINVAL;
                return addr;
        }