mm/mmap: Fix MTREE_INIT
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 22 Jan 2021 19:39:29 +0000 (14:39 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 22 Jan 2021 19:39:29 +0000 (14:39 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/mmap.c

index ae0e27604a9cb2028b12437440ef884667dc4f61..b7f6e27411adf4591aad84f2947203252ba1e35c 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2332,9 +2332,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  */
 
@@ -2406,6 +2406,8 @@ int do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,
                        return error;
        }
 
+       mtree_init(&mt_detach, MAPLE_ALLOC_RANGE);
+       dst.tree = &mt_detach;
        /* Point of no return */
        max = detach_range(mm, mas, &dst, vma, prev, &last);