diff options
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1640,7 +1640,7 @@ static void unmap_vma_list(struct mm_struct *mm, struct vm_area_struct *vma) | |||
1640 | /* | 1640 | /* |
1641 | * Get rid of page table information in the indicated region. | 1641 | * Get rid of page table information in the indicated region. |
1642 | * | 1642 | * |
1643 | * Called with the page table lock held. | 1643 | * Called with the mm semaphore held. |
1644 | */ | 1644 | */ |
1645 | static void unmap_region(struct mm_struct *mm, | 1645 | static void unmap_region(struct mm_struct *mm, |
1646 | struct vm_area_struct *vma, struct vm_area_struct *prev, | 1646 | struct vm_area_struct *vma, struct vm_area_struct *prev, |
@@ -1993,6 +1993,9 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma) | |||
1993 | __vma = find_vma_prepare(mm,vma->vm_start,&prev,&rb_link,&rb_parent); | 1993 | __vma = find_vma_prepare(mm,vma->vm_start,&prev,&rb_link,&rb_parent); |
1994 | if (__vma && __vma->vm_start < vma->vm_end) | 1994 | if (__vma && __vma->vm_start < vma->vm_end) |
1995 | return -ENOMEM; | 1995 | return -ENOMEM; |
1996 | if ((vma->vm_flags & VM_ACCOUNT) && | ||
1997 | security_vm_enough_memory(vma_pages(vma))) | ||
1998 | return -ENOMEM; | ||
1996 | vma_link(mm, vma, prev, rb_link, rb_parent); | 1999 | vma_link(mm, vma, prev, rb_link, rb_parent); |
1997 | return 0; | 2000 | return 0; |
1998 | } | 2001 | } |