From 4e25c0e92f8eaf69bc51d1d523bcb7268e7dd162 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 10 Dec 2013 11:35:47 +0100 Subject: m68k/mm: Check for mm != NULL in do_page_fault() debug code When DEBUG is enabled, do_page_fault() may dereference a NULL pointer, causing recursive bus errors. Signed-off-by: Geert Uytterhoeven --- arch/m68k/mm/fault.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/m68k') diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c index eb1d61f68725..c7725f1de05d 100644 --- a/arch/m68k/mm/fault.c +++ b/arch/m68k/mm/fault.c @@ -77,8 +77,7 @@ int do_page_fault(struct pt_regs *regs, unsigned long address, #ifdef DEBUG printk ("do page fault:\nregs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld, %p\n", - regs->sr, regs->pc, address, error_code, - current->mm->pgd); + regs->sr, regs->pc, address, error_code, mm ? mm->pgd : NULL); #endif /* -- cgit v1.2.3