diff options
Diffstat (limited to 'lib/bug.c')
-rw-r--r-- | lib/bug.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -181,6 +181,15 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) | |||
181 | } | 181 | } |
182 | } | 182 | } |
183 | 183 | ||
184 | /* | ||
185 | * BUG() and WARN_ON() families don't print a custom debug message | ||
186 | * before triggering the exception handler, so we must add the | ||
187 | * "cut here" line now. WARN() issues its own "cut here" before the | ||
188 | * extra debugging message it writes before triggering the handler. | ||
189 | */ | ||
190 | if ((bug->flags & BUGFLAG_NO_CUT_HERE) == 0) | ||
191 | printk(KERN_DEFAULT CUT_HERE); | ||
192 | |||
184 | if (warning) { | 193 | if (warning) { |
185 | /* this is a WARN_ON rather than BUG/BUG_ON */ | 194 | /* this is a WARN_ON rather than BUG/BUG_ON */ |
186 | __warn(file, line, (void *)bugaddr, BUG_GET_TAINT(bug), regs, | 195 | __warn(file, line, (void *)bugaddr, BUG_GET_TAINT(bug), regs, |
@@ -188,8 +197,6 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) | |||
188 | return BUG_TRAP_TYPE_WARN; | 197 | return BUG_TRAP_TYPE_WARN; |
189 | } | 198 | } |
190 | 199 | ||
191 | printk(KERN_DEFAULT CUT_HERE); | ||
192 | |||
193 | if (file) | 200 | if (file) |
194 | pr_crit("kernel BUG at %s:%u!\n", file, line); | 201 | pr_crit("kernel BUG at %s:%u!\n", file, line); |
195 | else | 202 | else |