diff mbox series

USB: serial: xr: avoid requesting zero DTE rate

Message ID 20221129141857.15363-1-johan@kernel.org
State New
Headers show
Series USB: serial: xr: avoid requesting zero DTE rate | expand

Commit Message

Johan Hovold Nov. 29, 2022, 2:18 p.m. UTC
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.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/xr_serial.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Greg Kroah-Hartman Nov. 30, 2022, 11:09 a.m. UTC | #1
On Tue, Nov 29, 2022 at 03:18:57PM +0100, Johan Hovold wrote:
> 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.
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff mbox series

Patch

diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c
index f3811e060a44..fdb0aae546c3 100644
--- a/drivers/usb/serial/xr_serial.c
+++ b/drivers/usb/serial/xr_serial.c
@@ -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);