Re: [PATCH] can: gs_usb: gs_usb_receive_bulk_callback(): unanchor URL on usb_submit_urb() error

From: Marc Kleine-Budde

Date: Fri Jan 16 2026 - 14:43:56 EST


On 16.01.2026 18:00:31, Marc Kleine-Budde wrote:
> In commit 7352e1d5932a ("can: gs_usb: gs_usb_receive_bulk_callback(): fix
> URB memory leak"), the URB was re-anchored before usb_submit_urb() in
> gs_usb_receive_bulk_callback() to prevent a leak of this URB during
> cleanup.
>
> However, this patch did not take into account that usb_submit_urb() could
> fail. The URB remains anchored and
> usb_kill_anchored_urbs(&parent->rx_submitted) in gs_can_close() loops
> infinitely since the anchor list never becomes empty.
>
> To fix the bug, unanchor the URB when an usb_submit_urb() error occurs,
> also print an info message
>
> Fixes: 7352e1d5932a ("can: gs_usb: gs_usb_receive_bulk_callback(): fix URB memory leak")
> Reported-by: Jakub Kicinski <kuba@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/20260110223836.3890248-1-kuba@xxxxxxxxxx/
> Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>

Applied to linux-can.

Thanks,
Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |

Attachment: signature.asc
Description: PGP signature