aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/panic.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/panic.c')
-rw-r--r--kernel/panic.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index c35c9eca3eb2..e0a87bb025c0 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -321,6 +321,28 @@ void warn_on_slowpath(const char *file, int line)
321 add_taint(TAINT_WARN); 321 add_taint(TAINT_WARN);
322} 322}
323EXPORT_SYMBOL(warn_on_slowpath); 323EXPORT_SYMBOL(warn_on_slowpath);
324
325
326void warn_slowpath(const char *file, int line, const char *fmt, ...)
327{
328 va_list args;
329 char function[KSYM_SYMBOL_LEN];
330 unsigned long caller = (unsigned long)__builtin_return_address(0);
331 sprint_symbol(function, caller);
332
333 printk(KERN_WARNING "------------[ cut here ]------------\n");
334 printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
335 line, function);
336 va_start(args, fmt);
337 vprintk(fmt, args);
338 va_end(args);
339
340 print_modules();
341 dump_stack();
342 print_oops_end_marker();
343 add_taint(TAINT_WARN);
344}
345EXPORT_SYMBOL(warn_slowpath);
324#endif 346#endif
325 347
326#ifdef CONFIG_CC_STACKPROTECTOR 348#ifdef CONFIG_CC_STACKPROTECTOR