diff options
Diffstat (limited to 'mm/mremap.c')
-rw-r--r-- | mm/mremap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/mremap.c b/mm/mremap.c index 4c4c803453f3..e9c75efce609 100644 --- a/mm/mremap.c +++ b/mm/mremap.c | |||
@@ -460,8 +460,11 @@ unsigned long do_mremap(unsigned long addr, | |||
460 | if (vma_expandable(vma, new_len - old_len)) { | 460 | if (vma_expandable(vma, new_len - old_len)) { |
461 | int pages = (new_len - old_len) >> PAGE_SHIFT; | 461 | int pages = (new_len - old_len) >> PAGE_SHIFT; |
462 | 462 | ||
463 | vma_adjust(vma, vma->vm_start, | 463 | if (vma_adjust(vma, vma->vm_start, addr + new_len, |
464 | addr + new_len, vma->vm_pgoff, NULL); | 464 | vma->vm_pgoff, NULL)) { |
465 | ret = -ENOMEM; | ||
466 | goto out; | ||
467 | } | ||
465 | 468 | ||
466 | mm->total_vm += pages; | 469 | mm->total_vm += pages; |
467 | vm_stat_account(mm, vma->vm_flags, vma->vm_file, pages); | 470 | vm_stat_account(mm, vma->vm_flags, vma->vm_file, pages); |