diff options
| -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, | |||
| 826 | int ret; | 826 | int ret; |
| 827 | 827 | ||
| 828 | /* do the simple checks first */ | 828 | /* do the simple checks first */ |
| 829 | if (flags & MAP_FIXED || addr) { | 829 | if (flags & MAP_FIXED) { |
| 830 | printk(KERN_DEBUG | 830 | printk(KERN_DEBUG |
| 831 | "%d: Can't do fixed-address/overlay mmap of RAM\n", | 831 | "%d: Can't do fixed-address/overlay mmap of RAM\n", |
| 832 | current->pid); | 832 | current->pid); |
| @@ -1182,9 +1182,6 @@ unsigned long do_mmap_pgoff(struct file *file, | |||
| 1182 | 1182 | ||
| 1183 | kenter(",%lx,%lx,%lx,%lx,%lx", addr, len, prot, flags, pgoff); | 1183 | kenter(",%lx,%lx,%lx,%lx,%lx", addr, len, prot, flags, pgoff); |
| 1184 | 1184 | ||
| 1185 | if (!(flags & MAP_FIXED)) | ||
| 1186 | addr = round_hint_to_min(addr); | ||
| 1187 | |||
| 1188 | /* decide whether we should attempt the mapping, and if so what sort of | 1185 | /* decide whether we should attempt the mapping, and if so what sort of |
| 1189 | * mapping */ | 1186 | * mapping */ |
| 1190 | ret = validate_mmap_request(file, addr, len, prot, flags, pgoff, | 1187 | ret = validate_mmap_request(file, addr, len, prot, flags, pgoff, |
| @@ -1194,6 +1191,9 @@ unsigned long do_mmap_pgoff(struct file *file, | |||
| 1194 | return ret; | 1191 | return ret; |
| 1195 | } | 1192 | } |
| 1196 | 1193 | ||
| 1194 | /* we ignore the address hint */ | ||
| 1195 | addr = 0; | ||
| 1196 | |||
| 1197 | /* we've determined that we can make the mapping, now translate what we | 1197 | /* we've determined that we can make the mapping, now translate what we |
| 1198 | * now know into VMA flags */ | 1198 | * now know into VMA flags */ |
| 1199 | vm_flags = determine_vm_flags(file, prot, flags, capabilities); | 1199 | vm_flags = determine_vm_flags(file, prot, flags, capabilities); |
