diff options
author | David Howells <dhowells@redhat.com> | 2009-09-24 13:33:48 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-25 02:20:29 +0200 |
commit | 06aab5a3084e1d825384fa353e6df4c7949c8683 (patch) | |
tree | f4db2f267151e2173b86ee4b945bf07688d6ffd2 /mm/nommu.c | |
parent | NOMMU: Fallback for is_vmalloc_or_module_addr() should be inline (diff) | |
download | linux-06aab5a3084e1d825384fa353e6df4c7949c8683.tar.xz linux-06aab5a3084e1d825384fa353e6df4c7949c8683.zip |
NOMMU: Ignore mmap() address param as it is a hint
Ignore the address parameter given to NOMMU mmap() as it is a hint, rather
than giving an error if it's non-zero. MAP_FIXED still gets an error.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/nommu.c')
-rw-r--r-- | mm/nommu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/nommu.c b/mm/nommu.c index 6a002abcb58f..c73aa4753d79 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -826,7 +826,7 @@ static int validate_mmap_request(struct file *file, int ret; /* do the simple checks first */ - if (flags & MAP_FIXED || addr) { + if (flags & MAP_FIXED) { printk(KERN_DEBUG "%d: Can't do fixed-address/overlay mmap of RAM\n", current->pid); @@ -1182,9 +1182,6 @@ unsigned long do_mmap_pgoff(struct file *file, kenter(",%lx,%lx,%lx,%lx,%lx", addr, len, prot, flags, pgoff); - if (!(flags & MAP_FIXED)) - addr = round_hint_to_min(addr); - /* decide whether we should attempt the mapping, and if so what sort of * mapping */ ret = validate_mmap_request(file, addr, len, prot, flags, pgoff, @@ -1194,6 +1191,9 @@ unsigned long do_mmap_pgoff(struct file *file, return ret; } + /* we ignore the address hint */ + addr = 0; + /* we've determined that we can make the mapping, now translate what we * now know into VMA flags */ vm_flags = determine_vm_flags(file, prot, flags, capabilities); |