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

Commit c9ddb1d6 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman
Browse files

XTENSA: iss/console, fix potential deadlock



If the timer ticks while we are holding the spinlock, the system
deadlocks. It is due to synchronous del_timer.

So to fix that, use spinlocks that properly disable bottom halves.

Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Cc: Chris Zankel <chris@zankel.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 86e7e874
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -91,11 +91,10 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
 */
static void rs_close(struct tty_struct *tty, struct file * filp)
{
	spin_lock(&timer_lock);
	spin_lock_bh(&timer_lock);
	if (tty->count == 1)
		/* this will cause a deadlock if the timer ticks right now */
		del_timer_sync(&serial_timer);
	spin_unlock(&timer_lock);
	spin_unlock_bh(&timer_lock);
}