patch-2.1.48 linux/arch/mips/mm/fault.c

Next file: linux/arch/mips/mm/init.c
Previous file: linux/arch/mips/kernel/sysmips.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.47/linux/arch/mips/mm/fault.c linux/arch/mips/mm/fault.c
@@ -81,17 +81,6 @@
  */
 bad_area:
 	up(&mm->mmap_sem);
-	/* Did we have an exception handler installed? */
-
-	fixup = search_exception_table(regs->cp0_epc);
-	if (fixup) {
-		long new_epc;
-		new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc);
-		printk(KERN_DEBUG "Exception at [<%lx>] (%lx)\n",
-		       regs->cp0_epc, new_epc);
-		regs->cp0_epc = new_epc;
-		goto out;
-	}
 
 	if (user_mode(regs)) {
 		tsk->tss.cp0_badvaddr = address;
@@ -111,6 +100,18 @@
 		force_sig(SIGSEGV, tsk);
 		goto out;
 	}
+
+	/* Did we have an exception handler installed? */
+	fixup = search_exception_table(regs->cp0_epc);
+	if (fixup) {
+		long new_epc;
+		new_epc = fixup_exception(dpf_reg, fixup, regs->cp0_epc);
+		printk(KERN_DEBUG "%s: Exception at [<%lx>] (%lx)\n",
+		       tsk->comm, regs->cp0_epc, new_epc);
+		regs->cp0_epc = new_epc;
+		goto out;
+	}
+
 	/*
 	 * Oops. The kernel tried to access some bad page. We'll have to
 	 * terminate things with extreme prejudice.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov