]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/mmap: Fux do_mas_align_munmap() search for vma.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 2 Feb 2021 14:16:20 +0000 (09:16 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 2 Feb 2021 14:16:20 +0000 (09:16 -0500)
Use find instead of walk to search for the VMA to ensure a VMA is found
if the start does not fall on a VMA

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/mmap.c

index d4b199d0db5b52eadf7f09455ee7e0c0c8b337a8..9a2336a2a410556f36e51b7a216b6920b3981c7c 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2418,7 +2418,7 @@ int do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,
        }
 
        if (mas->node == MAS_START)
-               vma = mas_walk(mas);
+               vma = mas_find(mas, end - 1);
 
        if (unlikely(uf)) {
                /*
@@ -2458,7 +2458,7 @@ int do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,
        /* Unmap the region */
        mas_set(&dst, start);
        tmp = dst;
-       vma = mas_walk(&dst);
+       vma = mas_find(&dst, end - 1);
        unmap_region(mm, vma, &dst, start, end, prev, max);
 
        /* Statistics and freeing VMAs */