diff options
author | Kees Cook <keescook@chromium.org> | 2019-09-25 19:48:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-25 20:51:40 -0400 |
commit | d38aba49a9f72b862f1220739ca837c886fdc319 (patch) | |
tree | 5fbd7c166348c540777455a66c26635c8cde4c75 | |
parent | f2f84b05e02b7710a201f0017b3272ad7ef703d1 (diff) |
bug: lift "cut here" out of __warn()
In preparation for cleaning up "cut here", move the "cut here" logic up
out of __warn() and into callers that pass non-NULL args. For anyone
looking closely, there are two callers that pass NULL args: one already
explicitly prints "cut here". The remaining case is covered by how a WARN
is built, which will be cleaned up in the next patch.
Link: http://lkml.kernel.org/r/20190819234111.9019-5-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Drew Davenport <ddavenport@chromium.org>
Cc: Feng Tang <feng.tang@intel.com>
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Cc: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/panic.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index 79c153951b59..a643e5464296 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
@@ -559,9 +559,6 @@ void __warn(const char *file, int line, void *caller, unsigned taint, | |||
559 | { | 559 | { |
560 | disable_trace_on_warning(); | 560 | disable_trace_on_warning(); |
561 | 561 | ||
562 | if (args) | ||
563 | pr_warn(CUT_HERE); | ||
564 | |||
565 | if (file) | 562 | if (file) |
566 | pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n", | 563 | pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n", |
567 | raw_smp_processor_id(), current->pid, file, line, | 564 | raw_smp_processor_id(), current->pid, file, line, |
@@ -605,8 +602,9 @@ void warn_slowpath_fmt(const char *file, int line, unsigned taint, | |||
605 | { | 602 | { |
606 | struct warn_args args; | 603 | struct warn_args args; |
607 | 604 | ||
605 | pr_warn(CUT_HERE); | ||
606 | |||
608 | if (!fmt) { | 607 | if (!fmt) { |
609 | pr_warn(CUT_HERE); | ||
610 | __warn(file, line, __builtin_return_address(0), taint, | 608 | __warn(file, line, __builtin_return_address(0), taint, |
611 | NULL, NULL); | 609 | NULL, NULL); |
612 | return; | 610 | return; |