summary refs log tree commit diff
path: root/mm
diff options
context:
space:
mode:
authorSuren Baghdasaryan <surenb@google.com>2023-07-10 17:46:32 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-07-19 16:21:46 +0200
commite0d7a96b278abe69c207615c2639ab8bb11ba321 (patch)
tree844f846a1140f08de24da07d1c0f76295f699f6c /mm
parentb91748bdbfb10673bc128179eb71cf66cb9641c4 (diff)
downloadlinux-e0d7a96b278abe69c207615c2639ab8bb11ba321.tar.gz
mm/mmap: Fix VM_LOCKED check in do_vmi_align_munmap()
6.1 backport of the patch [1] uses 'next' vma instead of 'split' vma.
Fix the mistake.

[1] commit 606c812eb1d5 ("mm/mmap: Fix error path in do_vmi_align_munmap()")

Fixes: a149174ff8bb ("mm/mmap: Fix error path in do_vmi_align_munmap()")
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/mmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index b8af52db3bbe..1597a96b667f 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2484,7 +2484,7 @@ do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,
 			error = mas_store_gfp(&mas_detach, split, GFP_KERNEL);
 			if (error)
 				goto munmap_gather_failed;
-			if (next->vm_flags & VM_LOCKED)
+			if (split->vm_flags & VM_LOCKED)
 				locked_vm += vma_pages(split);
 
 			count++;