net: usb: usbnet: fix race in probe failure

[ Upstream commit b62f4c186c ]

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: Oliver Neukum <oneukum@suse.com>
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Link: https://patch.msgid.link/20241010131934.1499695-1-oneukum@suse.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Oliver Neukum 2024-10-10 15:19:14 +02:00 committed by Greg Kroah-Hartman
parent a17874a3a5
commit bc52115cc4

View File

@ -1874,6 +1874,7 @@ out1:
* 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_percpu(net->tstats); free_percpu(net->tstats);