Skip to contentSkip to conversation

sh: fix uninitialized spinlock

PATCH In review Akinobu Mita 2 participants 2 messages Oct 5, 2010 – Oct 6, 2010 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: fix uninitialized spinlock

The spinlock in traps_64.c is used without initialization. This fixes it by declaring DEFINE_SPINLOCK() and makes the spinlock static variable.

---
 arch/sh/kernel/traps_64.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/sh/kernel/traps_64.c +1 -1
index e67e140..fda6355 100644
@@ -50,7 +50,7 @@ asmlinkage void do_##name(unsigned long error_code, struct pt_regs *regs) \
 	do_unhandled_exception(trapnr, signr, str, __stringify(name), error_code, regs, current); \
 }
 
-spinlock_t die_lock;
+static DEFINE_SPINLOCK(die_lock);
 
 void die(const char * str, struct pt_regs * regs, long err)
 {
Signature · 1 line
1.6.0.6
#1 lore raw
Quoted 7 lines · Akinobu Mita

The spinlock in traps_64.c is used without initialization. This fixes it by declaring DEFINE_SPINLOCK() and makes the spinlock static variable.

Hmm, there was a reason why this was non-static before, but it seems like whatever that was has since corrected itself. Applied, thanks!