diff mbox series

[RFC] USB: ipeth: race between ipeth_close and error handling

Message ID 20231121144330.3990-1-oneukum@suse.com (mailing list archive)
State New, archived
Headers show
Series [RFC] USB: ipeth: race between ipeth_close and error handling | expand

Commit Message

Oliver Neukum Nov. 21, 2023, 2:43 p.m. UTC
ipheth_sndbulk_callback() can submit carrier_work
as a part of its error handling. That means that
the driver must make sure that the work is cancelled
after it has made sure that no more URB can terminate
with an error condition.

Hence the order of actions in ipeth_close() needs
to be inverted.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/net/usb/ipheth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 687d70cfc556..6eeef10edada 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -475,8 +475,8 @@  static int ipheth_close(struct net_device *net)
 {
 	struct ipheth_device *dev = netdev_priv(net);
 
-	cancel_delayed_work_sync(&dev->carrier_work);
 	netif_stop_queue(net);
+	cancel_delayed_work_sync(&dev->carrier_work);
 	return 0;
 }