[2/3] powerpc/watchdog: regs can't be null in soft_nmi_interrupt()

Message ID 1507783474-28210-2-git-send-email-mpe@ellerman.id.au
State Accepted
Commit 3ba45b7e46e2ae7c059f3335120aed5e2c749bd9
Headers show
  • [1/3] powerpc/watchdog: Tweak watchdog printks
Related show

Commit Message

Michael Ellerman Oct. 12, 2017, 4:44 a.m.
soft_nmi_interrupt() is called directly from the asm exception
handling code, which passes regs as a pointer to the stack. So regs
can't be NULL, it may be full of junk, but that's a separate problem.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
 arch/powerpc/kernel/watchdog.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)


diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
index 937cb92374c7..2494cbe34132 100644
--- a/arch/powerpc/kernel/watchdog.c
+++ b/arch/powerpc/kernel/watchdog.c
@@ -238,10 +238,7 @@  void soft_nmi_interrupt(struct pt_regs *regs)
 		pr_emerg("CPU %d self-detected hard LOCKUP\n", cpu);
-		if (regs)
-			show_regs(regs);
-		else
-			dump_stack();
+		show_regs(regs);