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++;