Skip to contentSkip to conversation

USB: serial: xr: avoid requesting zero DTE rate

PATCH In review Johan Hovold 2 participants 2 messages Nov 29, 2022 – Nov 30, 2022

Subsystems (2)
lore
Share & tools
lore

Johan Hovold

author maintainer
#0 lore raw

PATCH 1/1 USB: serial: xr: avoid requesting zero DTE rate

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.

---
 drivers/usb/serial/xr_serial.c | 2 --
 1 file changed, 2 deletions(-)
drivers/usb/serial/xr_serial.c +0 -2
index f3811e060a44..fdb0aae546c3 100644
@@ -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);
 
Signature · 1 line
2.37.4
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Johan Hovold

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.