From: Liam R. Howlett Date: Fri, 4 Sep 2020 15:27:31 +0000 (-0400) Subject: mm and fork: Fix mtree_destroy path X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ce020b55315d91db054b4d8dfa8cb551bce6bb95;p=users%2Fjedix%2Flinux-maple.git mm and fork: Fix mtree_destroy path Signed-off-by: Liam R. Howlett --- diff --git a/kernel/fork.c b/kernel/fork.c index 5cd131a3b892f..72fdd9f792152 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1079,6 +1079,7 @@ static inline void __mmput(struct mm_struct *mm) { VM_BUG_ON(atomic_read(&mm->mm_users)); + mt_clear_in_rcu(&mm->mm_mt); uprobe_clear_state(mm); exit_aio(mm); ksm_exit(mm); @@ -1093,7 +1094,6 @@ static inline void __mmput(struct mm_struct *mm) } if (mm->binfmt) module_put(mm->binfmt->module); - mt_clear_in_rcu(&mm->mm_mt); mmdrop(mm); } diff --git a/mm/mmap.c b/mm/mmap.c index e8d003699cfc5..4a5b66849c6f3 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -3001,7 +3001,7 @@ void exit_mmap(struct mm_struct *mm) } trace_exit_mmap(mm); - mtree_direct_destroy(&mm->mm_mt); + mtree_destroy(&mm->mm_mt); vm_unacct_memory(nr_accounted); }