VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Chen Wandun <chenwandun@huawei.com> 2021-09-02 14:56:52 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2021-09-03 09:58:14 -0700 commit: 5e22928abe671ea1541f19afb80523442938d342 parent: 9b593cb20283e68e5e65b09ca10038935297f05b
Commit Summary:
mm/mremap: fix memory account on do_munmap() failure
Diffstat:
1 file changed, 1 insertion, 1 deletion
diff --git a/mm/mremap.c b/mm/mremap.c
index 5989d3990020..badfe17ade1f 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -686,7 +686,7 @@ static unsigned long move_vma(struct vm_area_struct *vma,
 	if (do_munmap(mm, old_addr, old_len, uf_unmap) < 0) {
 		/* OOM: unable to split vma, just get accounts right */
 		if (vm_flags & VM_ACCOUNT && !(flags & MREMAP_DONTUNMAP))
-			vm_acct_memory(new_len >> PAGE_SHIFT);
+			vm_acct_memory(old_len >> PAGE_SHIFT);
 		excess = 0;
 	}