aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/ioc4_serial.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2010-06-01 16:52:52 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 16:47:41 -0400
commiteab4f5af6b07009d1fc48bac5f3215c0cbfb2fc3 (patch)
treee966fec1389f578bfcad82ba2e9ba831e93d815c /drivers/serial/ioc4_serial.c
parent192251352f912bccfb942ea35801d2357f11f592 (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/ioc4_serial.c')
-rw-r--r--drivers/serial/ioc4_serial.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c
index 8ad28fc64926..fcfe82653ac8 100644
--- a/drivers/serial/ioc4_serial.c
+++ b/drivers/serial/ioc4_serial.c
@@ -1685,11 +1685,12 @@ ioc4_change_speed(struct uart_port *the_port,
1685{ 1685{
1686 struct ioc4_port *port = get_ioc4_port(the_port, 0); 1686 struct ioc4_port *port = get_ioc4_port(the_port, 0);
1687 int baud, bits; 1687 int baud, bits;
1688 unsigned cflag; 1688 unsigned cflag, iflag;
1689 int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8; 1689 int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8;
1690 struct uart_state *state = the_port->state; 1690 struct uart_state *state = the_port->state;
1691 1691
1692 cflag = new_termios->c_cflag; 1692 cflag = new_termios->c_cflag;
1693 iflag = new_termios->c_iflag;
1693 1694
1694 switch (cflag & CSIZE) { 1695 switch (cflag & CSIZE) {
1695 case CS5: 1696 case CS5:
@@ -1741,12 +1742,12 @@ ioc4_change_speed(struct uart_port *the_port,
1741 1742
1742 state->port.tty->low_latency = 1; 1743 state->port.tty->low_latency = 1;
1743 1744
1744 if (I_IGNPAR(state->port.tty)) 1745 if (iflag & IGNPAR)
1745 the_port->ignore_status_mask &= ~(N_PARITY_ERROR 1746 the_port->ignore_status_mask &= ~(N_PARITY_ERROR
1746 | N_FRAMING_ERROR); 1747 | N_FRAMING_ERROR);
1747 if (I_IGNBRK(state->port.tty)) { 1748 if (iflag & IGNBRK) {
1748 the_port->ignore_status_mask &= ~N_BREAK; 1749 the_port->ignore_status_mask &= ~N_BREAK;
1749 if (I_IGNPAR(state->port.tty)) 1750 if (iflag & IGNPAR)
1750 the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; 1751 the_port->ignore_status_mask &= ~N_OVERRUN_ERROR;
1751 } 1752 }
1752 if (!(cflag & CREAD)) { 1753 if (!(cflag & CREAD)) {