diff options
author | Hugh Dickins <hughd@google.com> | 2012-03-06 21:28:52 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-06 22:49:08 +0100 |
commit | ce8fea7aa4ad9e3b40999a08622ef27c77159659 (patch) | |
tree | 7d8696e506db022aa03f5927c9593db4df1ac2b8 /mm/mmap.c | |
parent | Merge tag 'fixes-3.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/ar... (diff) | |
download | linux-ce8fea7aa4ad9e3b40999a08622ef27c77159659.tar.xz linux-ce8fea7aa4ad9e3b40999a08622ef27c77159659.zip |
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 '')
-rw-r--r-- | mm/mmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/mmap.c b/mm/mmap.c index 22e1a0b2f70c..09ce2cae07ca 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1266,8 +1266,9 @@ munmap_back: vma->vm_pgoff = pgoff; INIT_LIST_HEAD(&vma->anon_vma_chain); + error = -EINVAL; /* when rejecting VM_GROWSDOWN|VM_GROWSUP */ + if (file) { - error = -EINVAL; if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP)) goto free_vma; if (vm_flags & VM_DENYWRITE) { |