File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -124,24 +124,24 @@ static inline unsigned long get_break_insn_length(unsigned long pc)
124
124
125
125
asmlinkage void do_trap_break (struct pt_regs * regs )
126
126
{
127
- if (!user_mode (regs )) {
127
+ if (user_mode (regs )) {
128
+ force_sig_fault (SIGTRAP , TRAP_BRKPT ,
129
+ (void __user * )(regs -> sepc ));
130
+ return ;
131
+ }
132
+ #ifdef CONFIG_GENERIC_BUG
133
+ {
128
134
enum bug_trap_type type ;
129
135
130
136
type = report_bug (regs -> sepc , regs );
131
- switch (type ) {
132
- #ifdef CONFIG_GENERIC_BUG
133
- case BUG_TRAP_TYPE_WARN :
137
+ if (type == BUG_TRAP_TYPE_WARN ) {
134
138
regs -> sepc += get_break_insn_length (regs -> sepc );
135
139
return ;
136
- case BUG_TRAP_TYPE_BUG :
137
- #endif /* CONFIG_GENERIC_BUG */
138
- default :
139
- die (regs , "Kernel BUG" );
140
140
}
141
- } else {
142
- force_sig_fault (SIGTRAP , TRAP_BRKPT ,
143
- (void __user * )(regs -> sepc ));
144
141
}
142
+ #endif /* CONFIG_GENERIC_BUG */
143
+
144
+ die (regs , "Kernel BUG" );
145
145
}
146
146
147
147
#ifdef CONFIG_GENERIC_BUG
You can’t perform that action at this time.
0 commit comments