From: Andrew Morton Date: Fri, 23 Jun 2006 09:05:15 +0000 (-0700) Subject: [PATCH] mmput() might sleep X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0ae26f1b3159f3acb21ae1e866c3c7e16edd450f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] mmput() might sleep exit_aio() and exit_mmap() can sleep. But it's easy to accidentally call mmput() from inside locks. Cc: Dave Peterson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/fork.c b/kernel/fork.c index ac8100e3088a..195958a3a4d6 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -368,6 +368,8 @@ void fastcall __mmdrop(struct mm_struct *mm) */ void mmput(struct mm_struct *mm) { + might_sleep(); + if (atomic_dec_and_test(&mm->mm_users)) { exit_aio(mm); exit_mmap(mm);