From ef1ad177623878299bd49cf42a7974309b0c6435 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Mon, 26 Mar 2007 21:32:15 -0800 Subject: generic_serial: fix decoding of baud rate Commit d720bc4b8fc5d6d179ef094908d4fbb5e436ffad partially removed a private implementation of baud speed decoding. However it doesn't seem to be complete: after the speed is decoded, it is still being used as an index to a local speed table (array overrun, no doubt). This was found by Graham Murray who noticed it caused a 2.6.19 regression with the SX driver: https://bugs.gentoo.org/170554 Signed-off-by: Daniel Drake Acked-by: Alan Cox Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/char/generic_serial.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c index e769811e741..e2a0b6f3d33 100644 --- a/drivers/char/generic_serial.c +++ b/drivers/char/generic_serial.c @@ -711,12 +711,6 @@ void gs_close(struct tty_struct * tty, struct file * filp) } -static unsigned int gs_baudrates[] = { - 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, - 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 -}; - - void gs_set_termios (struct tty_struct * tty, struct ktermios * old_termios) { @@ -772,7 +766,6 @@ void gs_set_termios (struct tty_struct * tty, baudrate = tty_get_baud_rate(tty); - baudrate = gs_baudrates[baudrate]; if ((tiosp->c_cflag & CBAUD) == B38400) { if ( (port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) baudrate = 57600; -- cgit v1.2.3-18-g5258