[PATCH 03/11] USB: serial: digi_acceleport: always stop write urb on close

From: Johan Hovold

Date: Wed Jun 10 2026 - 09:28:22 EST


Explicitly stop the write URB on close() also if the device is being
unbound instead of relying on core to do it after returning.

Note that the dp_write_urb_in_use flag is cleared by the completion
handler.

Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
---
drivers/usb/serial/digi_acceleport.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 16ced067c5f9..7195a63da8a1 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -1116,7 +1116,6 @@ static void digi_close(struct usb_serial_port *port)
usb_kill_urb(port->read_urb);

mutex_lock(&port->serial->disc_mutex);
- /* if disconnected, just clear flags */
if (port->serial->disconnected)
goto exit;

@@ -1162,14 +1161,11 @@ static void digi_close(struct usb_serial_port *port)
TASK_INTERRUPTIBLE);
schedule_timeout(DIGI_CLOSE_TIMEOUT);
finish_wait(&priv->dp_flush_wait, &wait);
+exit:
+ mutex_unlock(&port->serial->disc_mutex);

/* shutdown any outstanding bulk writes */
usb_kill_urb(port->write_urb);
-exit:
- spin_lock_irq(&priv->dp_port_lock);
- priv->dp_write_urb_in_use = 0;
- spin_unlock_irq(&priv->dp_port_lock);
- mutex_unlock(&port->serial->disc_mutex);
}


--
2.53.0