diff options
author | Alan Cox <alan@linux.intel.com> | 2010-06-01 16:52:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 16:47:41 -0400 |
commit | eab4f5af6b07009d1fc48bac5f3215c0cbfb2fc3 (patch) | |
tree | e966fec1389f578bfcad82ba2e9ba831e93d815c /drivers/serial/ioc3_serial.c | |
parent | 192251352f912bccfb942ea35801d2357f11f592 (diff) |
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 <alan@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/ioc3_serial.c')
-rw-r--r-- | drivers/serial/ioc3_serial.c | 9 |
1 files changed, 5 insertions, 4 deletions
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, | |||
954 | struct ktermios *new_termios, struct ktermios *old_termios) | 954 | struct ktermios *new_termios, struct ktermios *old_termios) |
955 | { | 955 | { |
956 | struct ioc3_port *port = get_ioc3_port(the_port); | 956 | struct ioc3_port *port = get_ioc3_port(the_port); |
957 | unsigned int cflag; | 957 | unsigned int cflag, iflag; |
958 | int baud; | 958 | int baud; |
959 | int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8; | 959 | int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8; |
960 | struct uart_state *state = the_port->state; | 960 | struct uart_state *state = the_port->state; |
961 | 961 | ||
962 | cflag = new_termios->c_cflag; | 962 | cflag = new_termios->c_cflag; |
963 | iflag = new_termios->c_iflag; | ||
963 | 964 | ||
964 | switch (cflag & CSIZE) { | 965 | switch (cflag & CSIZE) { |
965 | case CS5: | 966 | case CS5: |
@@ -1000,12 +1001,12 @@ ioc3_change_speed(struct uart_port *the_port, | |||
1000 | 1001 | ||
1001 | state->port.tty->low_latency = 1; | 1002 | state->port.tty->low_latency = 1; |
1002 | 1003 | ||
1003 | if (I_IGNPAR(state->port.tty)) | 1004 | if (iflag & IGNPAR) |
1004 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR | 1005 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR |
1005 | | N_FRAMING_ERROR); | 1006 | | N_FRAMING_ERROR); |
1006 | if (I_IGNBRK(state->port.tty)) { | 1007 | if (iflag & IGNBRK) { |
1007 | the_port->ignore_status_mask &= ~N_BREAK; | 1008 | the_port->ignore_status_mask &= ~N_BREAK; |
1008 | if (I_IGNPAR(state->port.tty)) | 1009 | if (iflag & IGNPAR) |
1009 | the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; | 1010 | the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; |
1010 | } | 1011 | } |
1011 | if (!(cflag & CREAD)) { | 1012 | if (!(cflag & CREAD)) { |