Skip to content

Commit 03410e8

Browse files
Lin Yujunandrom3da
Lin Yujun
authored andcommitted
hexagon: Fix unbalanced spinlock in die()
die executes holding the spinlock of &die.lock and unlock it after printing the oops message. However in the code if the notify_die() returns NOTIFY_STOP , die() exit with returning 1 but never unlocked the spinlock. Fix this by adding spin_unlock_irq(&die.lock) before returning. Fixes: cf9750b ("Hexagon: Provide basic debugging and system trap support.") Signed-off-by: Lin Yujun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Brian Cain <[email protected]> Signed-off-by: Brian Cain <[email protected]>
1 parent e8265a9 commit 03410e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/hexagon/kernel/traps.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,10 @@ int die(const char *str, struct pt_regs *regs, long err)
195195
printk(KERN_EMERG "Oops: %s[#%d]:\n", str, ++die.counter);
196196

197197
if (notify_die(DIE_OOPS, str, regs, err, pt_cause(regs), SIGSEGV) ==
198-
NOTIFY_STOP)
198+
NOTIFY_STOP) {
199+
spin_unlock_irq(&die.lock);
199200
return 1;
201+
}
200202

201203
print_modules();
202204
show_regs(regs);

0 commit comments

Comments
 (0)