From eab4f5af6b07009d1fc48bac5f3215c0cbfb2fc3 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 1 Jun 2010 22:52:52 +0200 Subject: tty: serial - fix tty back references in termios One or two drivers go poking back into the tty from the termios setting routine in unsafe ways. We don't need to pass the tty down because the [ab]users are just using it to get at things they can get at anyway. This leaves low_latency setting to sort out along with set_ldisc use. Signed-off-by: Alan Cox Cc: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/serial/ioc3_serial.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/serial/ioc3_serial.c') diff --git a/drivers/serial/ioc3_serial.c b/drivers/serial/ioc3_serial.c index f164ba4eba02..93de907b1208 100644 --- a/drivers/serial/ioc3_serial.c +++ b/drivers/serial/ioc3_serial.c @@ -954,12 +954,13 @@ ioc3_change_speed(struct uart_port *the_port, struct ktermios *new_termios, struct ktermios *old_termios) { struct ioc3_port *port = get_ioc3_port(the_port); - unsigned int cflag; + unsigned int cflag, iflag; int baud; int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8; struct uart_state *state = the_port->state; cflag = new_termios->c_cflag; + iflag = new_termios->c_iflag; switch (cflag & CSIZE) { case CS5: @@ -1000,12 +1001,12 @@ ioc3_change_speed(struct uart_port *the_port, state->port.tty->low_latency = 1; - if (I_IGNPAR(state->port.tty)) + if (iflag & IGNPAR) the_port->ignore_status_mask &= ~(N_PARITY_ERROR | N_FRAMING_ERROR); - if (I_IGNBRK(state->port.tty)) { + if (iflag & IGNBRK) { the_port->ignore_status_mask &= ~N_BREAK; - if (I_IGNPAR(state->port.tty)) + if (iflag & IGNPAR) the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; } if (!(cflag & CREAD)) { -- cgit v1.2.2