summaryrefslogtreecommitdiff
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-12-04 03:40:46 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2009-12-11 14:44:58 +0300
commit2c6a10161d0b5fc047b5bd81b03693b9af99fab5 (patch)
tree298916728f640d1ae156a6dfc855b1c8f6c46e37 /mm/mmap.c
parent9206de95b1ea68357996ec02be5db0638a0de2c1 (diff)
downloadlinux-2c6a10161d0b5fc047b5bd81b03693b9af99fab5.tar.xz
switch do_brk() to get_unmapped_area()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index c04146da8efd..ed70a68e882a 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1985,20 +1985,14 @@ unsigned long do_brk(unsigned long addr, unsigned long len)
if (!len)
return addr;
- if ((addr + len) > TASK_SIZE || (addr + len) < addr)
- return -EINVAL;
-
- if (is_hugepage_only_range(mm, addr, len))
- return -EINVAL;
-
error = security_file_mmap(NULL, 0, 0, 0, addr, 1);
if (error)
return error;
flags = VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags;
- error = arch_mmap_check(addr, len, flags);
- if (error)
+ error = get_unmapped_area(NULL, addr, len, 0, MAP_FIXED);
+ if (error & ~PAGE_MASK)
return error;
/*