Skip to contentSkip to conversation

net: usb: usbnet: fix race in probe failure

PATCH Applied Oliver Neukum 2 participants 2 messages Oct 10, 2024 – Oct 15, 2024

Subsystems (5)
lore
Share & tools
lore

Oliver Neukum

author maintainer
#0 lore raw

PATCH 1/1 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.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
---
 drivers/net/usb/usbnet.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/usb/usbnet.c +1 -0
index 2506aa8c603e..ee1b5fd7b491 100644
@@ -1870,6 +1870,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 	 * may trigger an error resubmitting itself and, worse,
 	 * schedule a timer. So we kill it all just in case.
 	 */
+	usbnet_mark_going_away(dev);
 	cancel_work_sync(&dev->kevent);
 	del_timer_sync(&dev->delay);
 	free_netdev(net);
Signature · 1 line
2.46.1
#1 lore raw
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Thu, 10 Oct 2024 15:19:14 +0200 you wrote:

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.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")

[...]

Here is the summary with links:
- [net] net: usb: usbnet: fix race in probe failure

    https://git.kernel.org/netdev/net/c/b62f4c186c70

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html