Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3e351fa authored by Andrew Scull's avatar Andrew Scull Committed by Greg Kroah-Hartman
Browse files

bug: Remove redundant condition check in report_bug



[ Upstream commit 3ad1a6cb0abc63d036fc866bd7c2c5983516dec5 ]

report_bug() will return early if it cannot find a bug corresponding to
the provided address. The subsequent test for the bug will always be
true so remove it.

Fixes: 1b4cfe3c ("lib/bug.c: exclude non-BUG/WARN exceptions from report_bug()")
Signed-off-by: default avatarAndrew Scull <ascull@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Reviewed-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Acked-by: default avatarWill Deacon <will@kernel.org>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210318143311.839894-2-ascull@google.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 943e195a
Loading
Loading
Loading
Loading
+15 −18
Original line number Diff line number Diff line
@@ -155,9 +155,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)

	file = NULL;
	line = 0;
	warning = 0;

	if (bug) {
#ifdef CONFIG_DEBUG_BUGVERBOSE
#ifndef CONFIG_GENERIC_BUG_RELATIVE_POINTERS
	file = bug->file;
@@ -179,7 +177,6 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
		 */
		bug->flags |= BUGFLAG_DONE;
	}
	}

	if (warning) {
		/* this is a WARN_ON rather than BUG/BUG_ON */