Skip to content

Commit 81fbc6f

Browse files
Łukasz Bartosikgregkh
authored andcommitted
xhci: dbgtty: fix device unregister
commit 1f73b8b upstream. When DbC is disconnected then xhci_dbc_tty_unregister_device() is called. However if there is any user space process blocked on write to DbC terminal device then it will never be signalled and thus stay blocked indifinitely. This fix adds a tty_vhangup() call in xhci_dbc_tty_unregister_device(). The tty_vhangup() wakes up any blocked writers and causes subsequent write attempts to DbC terminal device to fail. Cc: stable <stable@kernel.org> Fixes: dfba217 ("usb: xhci: Add DbC support in xHCI driver") Signed-off-by: Łukasz Bartosik <ukaszb@chromium.org> Link: https://patch.msgid.link/20251119212910.1245694-1-ukaszb@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent aa55e09 commit 81fbc6f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/usb/host/xhci-dbgtty.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,12 @@ static void xhci_dbc_tty_unregister_device(struct xhci_dbc *dbc)
518518

519519
if (!port->registered)
520520
return;
521+
/*
522+
* Hang up the TTY. This wakes up any blocked
523+
* writers and causes subsequent writes to fail.
524+
*/
525+
tty_vhangup(port->port.tty);
526+
521527
tty_unregister_device(dbc_tty_driver, port->minor);
522528
xhci_dbc_tty_exit_port(port);
523529
port->registered = false;

0 commit comments

Comments
 (0)