]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/mmap: Fix __vma_adjust() memory leak.
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 27 Apr 2022 22:40:00 +0000 (18:40 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 27 Apr 2022 22:40:41 +0000 (18:40 -0400)
When shifting the arg pages, the maple state may be left with allocated
memory.  Free the memory by calling mas_destroy() unconditionally at the
end of the function.

Fixes: bd6a1fd58daf (mm: start tracking VMAs with maple tree)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
mm/mmap.c

index 6a37f5d2e4963621c8c231833fd32c8fd87dbe14..f52bbf9aa0245fb128990ea3f813440f63738f7f 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -904,6 +904,7 @@ again:
                uprobe_mmap(insert);
        }
 
+       mas_destroy(&mas);
        validate_mm(mm);
 
        return 0;