Re: [PATCH 2/4] can: gs_usb: gs_usb_probe(): init netdev completely before register_candev()

From: Marc Kleine-Budde

Date: Tue Oct 27 2026 - 05:27:01 EST


On 27.10.2026 07:37:27, netdev-bot+sashiko@xxxxxxxxxx wrote:
> A frame with an out-of-range channel id goes to the device_detach label
> instead. That code calls netif_device_detach() on every non-NULL canch[]
> entry, which writes to the state field of the freed netdev.
>
> The window is shorter now that no USB control messages run between
> registrations, but the ordering is the same. gs_usb_disconnect() is not
> affected, because usb_unbind_interface() disables the interface before it
> calls disconnect.
>
> Would it help to unregister all the registered channels first, so the last
> close stops the shared RX URBs, and only then free them?

Will be fixed in v5.

pw-bot: cr

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