[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240806172809.675044-1-forst@pen.gy>
Date: Tue, 6 Aug 2024 19:28:05 +0200
From: Foster Snowhill <forst@....gy>
To: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: Georgi Valkov <gvalkov@...il.com>,
Oliver Neukum <oneukum@...e.com>,
netdev@...r.kernel.org,
linux-usb@...r.kernel.org
Subject: [PATCH net-next 1/5] usbnet: ipheth: race between ipheth_close and error handling
From: Oliver Neukum <oneukum@...e.com>
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 ipheth_close() needs
to be inverted.
Signed-off-by: Oliver Neukum <oneukum@...e.com>
Signed-off-by: Foster Snowhill <forst@....gy>
Tested-by: Georgi Valkov <gvalkov@...il.com>
---
v1:
No code changes. Fixed two "ipeth" -> "ipheth" typos in commit msg.
RFC: https://lore.kernel.org/netdev/20231121144330.3990-1-oneukum@suse.com/
---
drivers/net/usb/ipheth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.45.1
Powered by blists - more mailing lists