USB: serial: xr: avoid requesting zero DTE rate
authorJohan Hovold <johan@kernel.org>
Tue, 29 Nov 2022 14:18:57 +0000 (15:18 +0100)
committerJohan Hovold <johan@kernel.org>
Wed, 30 Nov 2022 11:28:51 +0000 (12:28 +0100)
When the requested line speed is B0 (hangup) there is no need to use the
current speed in the line-coding request. This specifically avoids
requesting a zero DTE rate when the current speed is B0, which could
potentially confuse buggy firmware.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/xr_serial.c

index f3811e060a44164ff110c7cd2601ce10ac25d795..fdb0aae546c333762d22b71cdf38b51dcd12e99f 100644 (file)
@@ -749,8 +749,6 @@ static void xr_cdc_set_line_coding(struct tty_struct *tty,
 
        if (tty->termios.c_ospeed)
                lc->dwDTERate = cpu_to_le32(tty->termios.c_ospeed);
-       else if (old_termios)
-               lc->dwDTERate = cpu_to_le32(old_termios->c_ospeed);
        else
                lc->dwDTERate = cpu_to_le32(9600);