]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix find_vma_intersction() cache update with possible incorrect addr
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 9 Oct 2020 19:12:59 +0000 (15:12 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 19:13:01 +0000 (15:13 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/mmap.c

index 8a0c4605e7f7de7427a81e865ad099ece5a26c53..589f1107ea5b187712ba45b2beb655f7a6c5f4ab 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2102,13 +2102,14 @@ struct vm_area_struct *find_vma_intersection(struct mm_struct *mm,
                                             unsigned long end_addr)
 {
        struct vm_area_struct *vma;
+       unsigned long addr = start_addr;
 
        /* Check the cache first. */
        vma = vmacache_find(mm, start_addr);
        if (likely(vma))
                return vma;
 
-       vma = mt_find(&mm->mm_mt, &start_addr, end_addr - 1);
+       vma = mt_find(&mm->mm_mt, &addr, end_addr - 1);
        if (vma)
                vmacache_update(start_addr, vma);