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

Commit 7bccc365 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman
Browse files

n_tty: Fix stuck write wakeup



If signal-driven i/o is disabled while write wakeup is pending (ie.,
n_tty_write() has set TTY_DO_WRITE_WAKEUP but then signal-driven i/o
is disabled), the TTY_DO_WRITE_WAKEUP bit will never be cleared and
will cause tty_wakeup() to always call n_tty_write_wakeup.

Unconditionally clear the write wakeup, and since kill_fasync()
already checks if the fasync ptr is null, call kill_fasync()
unconditionally as well.

Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8f3a297
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -228,7 +228,7 @@ static ssize_t chars_in_buffer(struct tty_struct *tty)


static void n_tty_write_wakeup(struct tty_struct *tty)
static void n_tty_write_wakeup(struct tty_struct *tty)
{
{
	if (tty->fasync && test_and_clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags))
	clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
	kill_fasync(&tty->fasync, SIGIO, POLL_OUT);
	kill_fasync(&tty->fasync, SIGIO, POLL_OUT);
}
}