]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/mmap: Use mtree_init() in do_mas_align_munmap()
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 1 Feb 2021 18:47:49 +0000 (13:47 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 1 Feb 2021 18:47:49 +0000 (13:47 -0500)
Don't use MTREE_INIT()

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

index 98609612c47eddf1f07a6d1fe30e1b5d795646cc..f44137bacc5602d465f3dd06e6aade1b9cda820a 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2360,9 +2360,9 @@ int do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,
                        unsigned long end, struct list_head *uf, bool downgrade)
 {
        struct vm_area_struct *prev, *last;
-       struct maple_tree mt_detach = MTREE_INIT(mt_detach, MAPLE_ALLOC_RANGE);
+       struct maple_tree mt_detach;
        unsigned long max;
-       MA_STATE(dst, &mt_detach, start, start);
+       MA_STATE(dst, NULL, start, start);
        struct ma_state tmp;
        /* we have start < vma->vm_end  */
 
@@ -2434,6 +2434,8 @@ int do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,
        }
 
        /* Point of no return */
+       mtree_init(&mt_detach, MAPLE_ALLOC_RANGE);
+       dst.tree = &mt_detach;
        max = detach_range(mm, mas, &dst, vma, prev, &last);
 
        /*