Skip to contentSkip to conversation

sparc: serial: sunhv: fix a double lock bug

PATCH In review Dan Carpenter 2 participants 2 messages Jul 15, 2016 – Jul 28, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc: serial: sunhv: fix a double lock bug

We accidentally take the "port->lock" twice in a row. This old code was supposed to be deleted.

Fixes e58e241c1788 ('sparc: serial: Clean up the locking for -rt')
drivers/tty/serial/sunhv.c +0 -6
index ca0d380..4e603d0 100644
@@ -490,12 +490,6 @@ static void sunhv_console_write_bychar(struct console *con, const char *s, unsig
 		locked = spin_trylock_irqsave(&port->lock, flags);
 	else
 		spin_lock_irqsave(&port->lock, flags);
-	if (port->sysrq) {
-		locked = 0;
-	} else if (oops_in_progress) {
-		locked = spin_trylock(&port->lock);
-	} else
-		spin_lock(&port->lock);
 
 	for (i = 0; i < n; i++) {
 		if (*s = '\n')
maintainer
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Fri, 15 Jul 2016 14:17:33 +0300

Quoted 5 lines

We accidentally take the "port->lock" twice in a row. This old code was supposed to be deleted.

Fixes e58e241c1788 ('sparc: serial: Clean up the locking for -rt')

Applied and queued up for -stable, thanks Dan.