netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/5] usbnet: ipheth: race between ipheth_close and error handling
@ 2024-08-06 17:28 Foster Snowhill
  2024-08-06 17:28 ` [PATCH net-next 2/5] usbnet: ipheth: remove extraneous rx URB length check Foster Snowhill
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Foster Snowhill @ 2024-08-06 17:28 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Georgi Valkov, Oliver Neukum, netdev, linux-usb

From: Oliver Neukum <oneukum@suse.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@suse.com>
Signed-off-by: Foster Snowhill <forst@pen.gy>
Tested-by: Georgi Valkov <gvalkov@gmail.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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-09-07 23:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-06 17:28 [PATCH net-next 1/5] usbnet: ipheth: race between ipheth_close and error handling Foster Snowhill
2024-08-06 17:28 ` [PATCH net-next 2/5] usbnet: ipheth: remove extraneous rx URB length check Foster Snowhill
2024-08-09 10:16   ` Simon Horman
2024-09-07 23:21     ` Foster Snowhill
2024-08-06 17:28 ` [PATCH net-next 3/5] usbnet: ipheth: drop RX URBs with no payload Foster Snowhill
2024-08-06 17:28 ` [PATCH net-next 4/5] usbnet: ipheth: do not stop RX on failing RX callback Foster Snowhill
2024-08-06 17:28 ` [PATCH net-next 5/5] usbnet: ipheth: fix carrier detection in modes 1 and 4 Foster Snowhill
2024-08-09 13:00 ` [PATCH net-next 1/5] usbnet: ipheth: race between ipheth_close and error handling patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).