patch-2.3.16 linux/arch/ppc/mm/fault.c

Next file: linux/arch/ppc/mm/init.c
Previous file: linux/arch/ppc/math-emu/udivmodti4.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.15/linux/arch/ppc/mm/fault.c linux/arch/ppc/mm/fault.c
@@ -82,20 +82,16 @@
 			return;
 	}
 #endif
-	if (in_interrupt() || !mm) {
+	if (in_interrupt()) {
 		static int complained;
 		if (complained < 20) {
 			++complained;
 			printk("page fault in interrupt handler, addr=%lx\n",
 			       address);
 			show_regs(regs);
-#if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
-			if (debugger_kernel_faults)
-				debugger(regs);
-#endif
 		}
 	}
-	if (current == NULL) {
+	if (current == NULL || mm == NULL) {
 		bad_page_fault(regs, address);
 		return;
 	}
@@ -161,6 +157,7 @@
 bad_page_fault(struct pt_regs *regs, unsigned long address)
 {
 	unsigned long fixup;
+
 	if (user_mode(regs)) {
 		force_sig(SIGSEGV, current);
 		return;
@@ -174,11 +171,11 @@
 
 	/* kernel has accessed a bad area */
 	show_regs(regs);
-	print_backtrace( (unsigned long *)regs->gpr[1] );
 #if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
 	if (debugger_kernel_faults)
 		debugger(regs);
 #endif
+	print_backtrace( (unsigned long *)regs->gpr[1] );
 	panic("kernel access of bad area pc %lx lr %lx address %lX tsk %s/%d",
 	      regs->nip,regs->link,address,current->comm,current->pid);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)