m68k/mm: Check for mm != NULL in do_page_fault() debug code
authorGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 10 Dec 2013 10:35:47 +0000 (11:35 +0100)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 30 Dec 2013 20:01:09 +0000 (21:01 +0100)
When DEBUG is enabled, do_page_fault() may dereference a NULL pointer,
causing recursive bus errors.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/mm/fault.c

index eb1d61f6872549991dae7d5e491a74627d8456d0..c7725f1de05d03868fd04edea558f671c6a8ad55 100644 (file)
@@ -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
 
        /*