]> Git Repo - linux.git/blobdiff - mm/mmap.c
mm: remove duplicated vma->vm_flags check when expanding stack
[linux.git] / mm / mmap.c
index b56a7f0c9f856509a7a17eac92c71f2ce30b659c..42870c4d87047d46bc635baf3083b088fb500108 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2159,8 +2159,6 @@ struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, unsigned lon
 #else
 int expand_stack_locked(struct vm_area_struct *vma, unsigned long address)
 {
-       if (unlikely(!(vma->vm_flags & VM_GROWSDOWN)))
-               return -EINVAL;
        return expand_downwards(vma, address);
 }
 
@@ -3278,7 +3276,8 @@ int insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma)
        }
 
        if (vma_link(mm, vma)) {
-               vm_unacct_memory(charged);
+               if (vma->vm_flags & VM_ACCOUNT)
+                       vm_unacct_memory(charged);
                return -ENOMEM;
        }
 
This page took 0.03308 seconds and 4 git commands to generate.