Skip to content

Commit

Permalink
bug: lift "cut here" out of __warn()
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Kees Cook <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Drew Davenport <[email protected]>
Cc: Feng Tang <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Petr Mladek <[email protected]>
Cc: "Steven Rostedt (VMware)" <[email protected]>
Cc: YueHaibing <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kees authored and torvalds committed Sep 26, 2019
1 parent f2f84b0 commit d38aba4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kernel/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,6 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
{
disable_trace_on_warning();

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,
Expand Down Expand Up @@ -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,
NULL, NULL);
return;
Expand Down

0 comments on commit d38aba4

Please sign in to comment.