net: hso: fix TIOCMIWAIT race
Subsystems (6)
PATCH 1/1 net: hso: fix TIOCMIWAIT race
The task state must be updated before checking the wakeup condition to avoid missing a racing modem status update.
Fixes 542f54823614 ("tty: Modem functions for the HSO driver")
Cc [email protected] # 2.6.29
Signed-off-by Johan Hovold <[email protected]>
--- drivers/net/usb/hso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/hso.c +1 -1
@@ -1547,10 +1547,10 @@ hso_wait_modem_status(struct hso_serial *serial, unsigned long arg)spin_unlock_irq (&serial->serial_lock);add_wait_queue (&tiocmget->waitq, &wait);for (;;) { +set_current_state (TASK_INTERRUPTIBLE );spin_lock_irq (&serial->serial_lock);memcpy (&cnow, &tiocmget->icount,sizeof (struct uart_icount ));spin_unlock_irq (&serial->serial_lock); -set_current_state (TASK_INTERRUPTIBLE );if (((arg &TIOCM_RNG ) && (cnow.rng != cprev.rng)) || ((arg &TIOCM_DSR ) && (cnow.dsr != cprev.dsr)) || ((arg &TIOCM_CD ) && (cnow.dcd != cprev.dcd))) {
Signature · 1 line
2.55.0
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Mon, 7 Sep 2026 08:52:35 +0200 you wrote:
The task state must be updated before checking the wakeup condition to avoid missing a racing modem status update.
Fixes 542f54823614 ("tty: Modem functions for the HSO driver")Cc [email protected] # 2.6.29Signed-off-by Johan Hovold <[email protected]>[...]
Here is the summary with links:
- [net] net: hso: fix TIOCMIWAIT race
https://git.kernel.org/netdev/net/c/00f9fbc12320
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html