From: Liam R. Howlett Date: Wed, 27 Apr 2022 22:40:00 +0000 (-0400) Subject: mm/mmap: Fix __vma_adjust() memory leak. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=74f551227d44b351d56f4ec0a36542d871f337d5;p=users%2Fjedix%2Flinux-maple.git mm/mmap: Fix __vma_adjust() memory leak. 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 --- diff --git a/mm/mmap.c b/mm/mmap.c index 6a37f5d2e4963..f52bbf9aa0245 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -904,6 +904,7 @@ again: uprobe_mmap(insert); } + mas_destroy(&mas); validate_mm(mm); return 0;