Commit b62f4c18 authored by Oliver Neukum's avatar Oliver Neukum Committed by Paolo Abeni

net: usb: usbnet: fix race in probe failure

The same bug as in the disconnect code path also exists
in the case of a failure late during the probe process.
The flag must also be set.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Link: https://patch.msgid.link/20241010131934.1499695-1-oneukum@suse.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 25c12b45
...@@ -1870,6 +1870,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) ...@@ -1870,6 +1870,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
* may trigger an error resubmitting itself and, worse, * may trigger an error resubmitting itself and, worse,
* schedule a timer. So we kill it all just in case. * schedule a timer. So we kill it all just in case.
*/ */
usbnet_mark_going_away(dev);
cancel_work_sync(&dev->kevent); cancel_work_sync(&dev->kevent);
del_timer_sync(&dev->delay); del_timer_sync(&dev->delay);
free_netdev(net); free_netdev(net);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment