Re: [PATCH] USB: serial: f81232: drain work on failed open

From: Johan Hovold

Date: Tue Nov 17 2026 - 07:35:59 EST


On Mon, Nov 16, 2026 at 01:10:24PM +0800, Haowen Tu wrote:
> The interrupt URB is submitted before usb_serial_generic_open() starts
> the bulk read URBs. A modem-status notification can therefore queue
> interrupt_work before a bulk read submission fails. A bulk read that
> completes before a later submission fails can also queue lsr_work.
>
> The error path kills the interrupt URB but does not drain either work
> item. The tty port is not initialized after a failed open, so the close
> callback, which normally flushes this work, is not called. If the device
> is then disconnected, the work can outlive the port private data it uses.
>
> Flush both work items after killing the interrupt URB. The generic open
> error path has already killed any submitted bulk read URBs, so neither
> source can queue more work at this point.
>
> Fixes: 87fe5adcd8de ("USB: f81232: implement read IIR/MSR with endpoint")
> Signed-off-by: Haowen Tu <tuhaowen@xxxxxxxxxxxxx>

Applied for 7.4 with a CC stable tag. Thanks.

Johan