path: root/kernel
diff options
authorKees Cook <>2019-09-25 16:48:01 -0700
committerLinus Torvalds <>2019-09-25 17:51:40 -0700
commitd38aba49a9f72b862f1220739ca837c886fdc319 (patch)
tree5fbd7c166348c540777455a66c26635c8cde4c75 /kernel
parentf2f84b05e02b7710a201f0017b3272ad7ef703d1 (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: Signed-off-by: Kees Cook <> Cc: Arnd Bergmann <> Cc: Borislav Petkov <> Cc: Christophe Leroy <> Cc: Drew Davenport <> Cc: Feng Tang <> Cc: Mauro Carvalho Chehab <> Cc: Peter Zijlstra <> Cc: Petr Mladek <> Cc: "Steven Rostedt (VMware)" <> Cc: YueHaibing <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'kernel')
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,
- if (args)
- pr_warn(CUT_HERE);
if (file)
pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n",
raw_smp_processor_id(), current->pid, file, line,
@@ -605,8 +602,9 @@ void warn_slowpath_fmt(const char *file, int line, unsigned taint,
struct warn_args args;
+ pr_warn(CUT_HERE);
if (!fmt) {
- pr_warn(CUT_HERE);
__warn(file, line, __builtin_return_address(0), taint,