diff options
| author | 2018-11-08 09:32:24 -0800 | |
|---|---|---|
| committer | 2018-11-08 09:32:24 -0800 | |
| commit | 91e43395820baad80248987608216c35da9df65b (patch) | |
| tree | 29d41d1a036eb1abd6a60f16ad37aa578acd8159 /kernel/panic.c | |
| parent | ARM: OMAP2+: prm44xx: Fix section annotation on omap44xx_prm_enable_io_wakeup (diff) | |
| parent | ARM: OMAP1: ams-delta: Fix possible use of uninitialized field (diff) | |
Merge branch 'fixes-dts' into omap-for-v4.20/fixes
Diffstat (limited to 'kernel/panic.c')
| -rw-r--r-- | kernel/panic.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index 8b2e002d52eb..f6d549a29a5c 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -136,7 +136,7 @@ void panic(const char *fmt, ...) { static char buf[1024]; va_list args; - long i, i_next = 0; + long i, i_next = 0, len; int state = 0; int old_cpu, this_cpu; bool _crash_kexec_post_notifiers = crash_kexec_post_notifiers; @@ -173,8 +173,12 @@ void panic(const char *fmt, ...) console_verbose(); bust_spinlocks(1); va_start(args, fmt); - vsnprintf(buf, sizeof(buf), fmt, args); + len = vscnprintf(buf, sizeof(buf), fmt, args); va_end(args); + + if (len && buf[len - 1] == '\n') + buf[len - 1] = '\0'; + pr_emerg("Kernel panic - not syncing: %s\n", buf); #ifdef CONFIG_DEBUG_BUGVERBOSE /* @@ -631,7 +635,7 @@ device_initcall(register_warn_debugfs); */ __visible void __stack_chk_fail(void) { - panic("stack-protector: Kernel stack is corrupted in: %pB\n", + panic("stack-protector: Kernel stack is corrupted in: %pB", __builtin_return_address(0)); } EXPORT_SYMBOL(__stack_chk_fail); |
