public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH 1/3] m68k/mm: Check for mm != NULL in do_page_fault() debug code
@ 2013-12-10 11:11 Geert Uytterhoeven
  2013-12-10 11:11 ` [PATCH 2/3] m68k: Convert arch/m68k/kernel/traps.c to pr_*() Geert Uytterhoeven
  2013-12-10 11:12 ` [PATCH 3/3] m68k: Convert arch/m68k/mm/fault.c " Geert Uytterhoeven
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2013-12-10 11:11 UTC (permalink / raw)
  To: linux-m68k; +Cc: Joe Perches, linux-kernel, Geert Uytterhoeven

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 |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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
 
 	/*
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-10 11:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10 11:11 [PATCH 1/3] m68k/mm: Check for mm != NULL in do_page_fault() debug code Geert Uytterhoeven
2013-12-10 11:11 ` [PATCH 2/3] m68k: Convert arch/m68k/kernel/traps.c to pr_*() Geert Uytterhoeven
2013-12-10 11:12 ` [PATCH 3/3] m68k: Convert arch/m68k/mm/fault.c " Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox