]> www.infradead.org Git - users/hch/configfs.git/commitdiff
usbnet: ipheth: race between ipheth_close and error handling
authorOliver Neukum <oneukum@suse.com>
Tue, 6 Aug 2024 17:28:05 +0000 (19:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Aug 2024 12:54:20 +0000 (13:54 +0100)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/ipheth.c

index 687d70cfc5563526d3e51d046bcc7a1bf3f00acc..6eeef10edadad1ba378c2f5b7de01aa14c91afd2 100644 (file)
@@ -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;
 }