From: Russell King Date: Sun, 20 Sep 2009 11:52:19 +0000 (+0100) Subject: ARM: Ensure correct might_sleep() check in pagefault path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bf4569922b97824f33e5d08d0bbe4b34fe43e4cd;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git ARM: Ensure correct might_sleep() check in pagefault path Signed-off-by: Russell King --- diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 501304f7e30..b8b3bb4423c 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -271,6 +271,13 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) if (!user_mode(regs) && !search_exception_tables(regs->ARM_pc)) goto no_context; down_read(&mm->mmap_sem); + } else { + /* + * The above down_read_trylock() might have succeeded in + * which case, we'll have missed the might_sleep() from + * down_read() + */ + might_sleep(); } fault = __do_page_fault(mm, addr, fsr, tsk);