diff options
author | Hugh Dickins <hughd@google.com> | 2012-03-06 15:28:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-06 16:49:08 -0500 |
commit | ce8fea7aa4ad9e3b40999a08622ef27c77159659 (patch) | |
tree | 7d8696e506db022aa03f5927c9593db4df1ac2b8 /mm/mmap.c | |
parent | 917ec63b61720b177271450399bca2f8c5168c0d (diff) |
mmap: EINVAL not ENOMEM when rejecting VM_GROWS
Currently error is -ENOMEM when rejecting VM_GROWSDOWN|VM_GROWSUP
from shared anonymous: hoist the file case's -EINVAL up for both.
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1266,8 +1266,9 @@ munmap_back: | |||
1266 | vma->vm_pgoff = pgoff; | 1266 | vma->vm_pgoff = pgoff; |
1267 | INIT_LIST_HEAD(&vma->anon_vma_chain); | 1267 | INIT_LIST_HEAD(&vma->anon_vma_chain); |
1268 | 1268 | ||
1269 | error = -EINVAL; /* when rejecting VM_GROWSDOWN|VM_GROWSUP */ | ||
1270 | |||
1269 | if (file) { | 1271 | if (file) { |
1270 | error = -EINVAL; | ||
1271 | if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP)) | 1272 | if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP)) |
1272 | goto free_vma; | 1273 | goto free_vma; |
1273 | if (vm_flags & VM_DENYWRITE) { | 1274 | if (vm_flags & VM_DENYWRITE) { |