浏览代码

Blackfin: fix trap_c() exit paths

The trap_c() code pushes the hardware trace status onto the stack, but
doesn't always restore it when returning from some trap code paths.  So
unify the exit code paths to all head to the end of the function.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Mike Frysinger 16 年之前
父节点
当前提交
6510a20e1b
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      arch/blackfin/kernel/traps.c

+ 5 - 5
arch/blackfin/kernel/traps.c

@@ -309,7 +309,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
 		CHK_DEBUGGER_TRAP_MAYBE();
 		CHK_DEBUGGER_TRAP_MAYBE();
 		/* Check if this is a breakpoint in kernel space */
 		/* Check if this is a breakpoint in kernel space */
 		if (fp->ipend & 0xffc0)
 		if (fp->ipend & 0xffc0)
-			return;
+			goto traps_done;
 		else
 		else
 			break;
 			break;
 	/* 0x03 - User Defined, userspace stack overflow */
 	/* 0x03 - User Defined, userspace stack overflow */
@@ -325,7 +325,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
 		info.si_code = TRAP_ILLTRAP;
 		info.si_code = TRAP_ILLTRAP;
 		sig = SIGTRAP;
 		sig = SIGTRAP;
 		CHK_DEBUGGER_TRAP();
 		CHK_DEBUGGER_TRAP();
-		return;
+		goto traps_done;
 #endif
 #endif
 	/* 0x04 - User Defined */
 	/* 0x04 - User Defined */
 	/* 0x05 - User Defined */
 	/* 0x05 - User Defined */
@@ -355,7 +355,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
 		CHK_DEBUGGER_TRAP_MAYBE();
 		CHK_DEBUGGER_TRAP_MAYBE();
 		/* Check if this is a single step in kernel space */
 		/* Check if this is a single step in kernel space */
 		if (fp->ipend & 0xffc0)
 		if (fp->ipend & 0xffc0)
-			return;
+			goto traps_done;
 		else
 		else
 			break;
 			break;
 	/* 0x11 - Trace Buffer Full, handled here */
 	/* 0x11 - Trace Buffer Full, handled here */
@@ -459,7 +459,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
 		CHK_DEBUGGER_TRAP_MAYBE();
 		CHK_DEBUGGER_TRAP_MAYBE();
 		/* Check if this is a watchpoint in kernel space */
 		/* Check if this is a watchpoint in kernel space */
 		if (fp->ipend & 0xffc0)
 		if (fp->ipend & 0xffc0)
-			return;
+			goto traps_done;
 		else
 		else
 			break;
 			break;
 #ifdef CONFIG_BF535
 #ifdef CONFIG_BF535
@@ -624,8 +624,8 @@ asmlinkage void trap_c(struct pt_regs *fp)
 	if (ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8))
 	if (ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8))
 		fp->pc = SAFE_USER_INSTRUCTION;
 		fp->pc = SAFE_USER_INSTRUCTION;
 
 
+ traps_done:
 	trace_buffer_restore(j);
 	trace_buffer_restore(j);
-	return;
 }
 }
 
 
 /* Typical exception handling routines	*/
 /* Typical exception handling routines	*/