summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2024-08-06 19:28:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-12 11:10:25 +0200
commit76d9cd56a4f6da9699227e3e0e891a632351ca98 (patch)
treeaf59597a171e52c346f5a17be055971d38399679 /drivers
parent61df76619e270a46fd427fbdeb670ad491c42de2 (diff)
downloadlinux-76d9cd56a4f6da9699227e3e0e891a632351ca98.tar.gz
linux-76d9cd56a4f6da9699227e3e0e891a632351ca98.tar.bz2
linux-76d9cd56a4f6da9699227e3e0e891a632351ca98.zip
usbnet: ipheth: race between ipheth_close and error handling
[ Upstream commit e5876b088ba03a62124266fa20d00e65533c7269 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/usb/ipheth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index 6a769df0b421..13381d87eeb0 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -353,8 +353,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;
}