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

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

serial: core: Claim port mutex for set_ldisc()



Three UART drivers (8250, atmel & amba-pl010) enable modem status
interrupts if the line discipline is changed to N_PPS. However,
the uart port flags may only be safely modified while holding the
port mutex.

Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9191aaaa
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1245,8 +1245,11 @@ static void uart_set_ldisc(struct tty_struct *tty)
	struct uart_state *state = tty->driver_data;
	struct uart_port *uport = state->uart_port;

	if (uport->ops->set_ldisc)
	if (uport->ops->set_ldisc) {
		mutex_lock(&state->port.mutex);
		uport->ops->set_ldisc(uport, tty->termios.c_line);
		mutex_unlock(&state->port.mutex);
	}
}

static void uart_set_termios(struct tty_struct *tty,