mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
USB: serial: digi_acceleport: fix hard lockup on disconnect
commit5c1ea24b53upstream. If submitting the OOB write urb fails persistently (e.g if the device is being disconnected) the driver would loop indefinitely with interrupts disabled. Check for urb submission errors when sending OOB commands to avoid hanging if, for example, open(), set_termios() or close() races with a physical disconnect. This is issue was flagged by Sashiko when reviewing an unrelated change to the driver. Link: https://sashiko.dev/#/patchset/20260610132232.356139-1-johan%40kernel.org?part=1 Fixes:1da177e4c3("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8d50a91019
commit
bcfeae431d
@@ -396,12 +396,14 @@ static int digi_write_oob_command(struct usb_serial_port *port,
|
||||
len &= ~3;
|
||||
memcpy(oob_port->write_urb->transfer_buffer, buf, len);
|
||||
oob_port->write_urb->transfer_buffer_length = len;
|
||||
|
||||
ret = usb_submit_urb(oob_port->write_urb, GFP_ATOMIC);
|
||||
if (ret == 0) {
|
||||
oob_priv->dp_write_urb_in_use = 1;
|
||||
count -= len;
|
||||
buf += len;
|
||||
}
|
||||
if (ret)
|
||||
break;
|
||||
|
||||
oob_priv->dp_write_urb_in_use = 1;
|
||||
count -= len;
|
||||
buf += len;
|
||||
}
|
||||
spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags);
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user