Subject: Re: [PATCH V3] usbnet: Prevents free active kevent

From: Jakub Kicinski <[email-masked]>
Date: Tue, 21 Oct 2025 18:32:52 -0700

On Sat, 18 Oct 2025 22:49:40 +0800 Lizhi Xu wrote:
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -1672,6 +1672,9 @@ void usbnet_disconnect (struct usb_interface *intf)
>  	usb_free_urb(dev->interrupt);
>  	kfree(dev->padding_pkt);
>  
> +	cancel_work_sync(&dev->kevent);
> +	timer_delete_sync(&dev->delay);
> +
>  	free_netdev(net);

Is this the best spot to place the cancel?
I think it may be better right after unregister_netdev().
I haven't analyze this driver too closely but for example since
kevent may call the sub-driver having it running after we already
called dev->driver_info->unbind() seems risky.
-- 
pw-bot: cr