diff options
Diffstat (limited to 'kernel/panic.c')
-rw-r--r-- | kernel/panic.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index 6513aac8e992..6bbf7b905c76 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
@@ -320,23 +320,6 @@ void oops_exit(void) | |||
320 | } | 320 | } |
321 | 321 | ||
322 | #ifdef WANT_WARN_ON_SLOWPATH | 322 | #ifdef WANT_WARN_ON_SLOWPATH |
323 | void warn_on_slowpath(const char *file, int line) | ||
324 | { | ||
325 | char function[KSYM_SYMBOL_LEN]; | ||
326 | unsigned long caller = (unsigned long) __builtin_return_address(0); | ||
327 | sprint_symbol(function, caller); | ||
328 | |||
329 | printk(KERN_WARNING "------------[ cut here ]------------\n"); | ||
330 | printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, | ||
331 | line, function); | ||
332 | print_modules(); | ||
333 | dump_stack(); | ||
334 | print_oops_end_marker(); | ||
335 | add_taint(TAINT_WARN); | ||
336 | } | ||
337 | EXPORT_SYMBOL(warn_on_slowpath); | ||
338 | |||
339 | |||
340 | void warn_slowpath(const char *file, int line, const char *fmt, ...) | 323 | void warn_slowpath(const char *file, int line, const char *fmt, ...) |
341 | { | 324 | { |
342 | va_list args; | 325 | va_list args; |
@@ -347,9 +330,12 @@ void warn_slowpath(const char *file, int line, const char *fmt, ...) | |||
347 | printk(KERN_WARNING "------------[ cut here ]------------\n"); | 330 | printk(KERN_WARNING "------------[ cut here ]------------\n"); |
348 | printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, | 331 | printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, |
349 | line, function); | 332 | line, function); |
350 | va_start(args, fmt); | 333 | |
351 | vprintk(fmt, args); | 334 | if (fmt) { |
352 | va_end(args); | 335 | va_start(args, fmt); |
336 | vprintk(fmt, args); | ||
337 | va_end(args); | ||
338 | } | ||
353 | 339 | ||
354 | print_modules(); | 340 | print_modules(); |
355 | dump_stack(); | 341 | dump_stack(); |
@@ -357,6 +343,12 @@ void warn_slowpath(const char *file, int line, const char *fmt, ...) | |||
357 | add_taint(TAINT_WARN); | 343 | add_taint(TAINT_WARN); |
358 | } | 344 | } |
359 | EXPORT_SYMBOL(warn_slowpath); | 345 | EXPORT_SYMBOL(warn_slowpath); |
346 | |||
347 | void warn_on_slowpath(const char *file, int line) | ||
348 | { | ||
349 | warn_slowpath(file, line, NULL); | ||
350 | } | ||
351 | EXPORT_SYMBOL(warn_on_slowpath); | ||
360 | #endif | 352 | #endif |
361 | 353 | ||
362 | #ifdef CONFIG_CC_STACKPROTECTOR | 354 | #ifdef CONFIG_CC_STACKPROTECTOR |