aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can/usb/usb_8dev.c
diff options
context:
space:
mode:
authorJohan Hovold <[email protected]>2019-10-01 10:29:14 +0000
committerMarc Kleine-Budde <[email protected]>2019-11-04 20:47:20 +0000
commit3759739426186a924675651b388d1c3963c5710e (patch)
tree1e92124b653389dcb7d46785647c2bcb16ed2bbb /drivers/net/can/usb/usb_8dev.c
parentcan: mcba_usb: fix use-after-free on disconnect (diff)
downloadkernel-3759739426186a924675651b388d1c3963c5710e.tar.gz
kernel-3759739426186a924675651b388d1c3963c5710e.zip
can: usb_8dev: fix use-after-free on disconnect
The driver was accessing its driver data after having freed it. Fixes: 0024d8ad1639 ("can: usb_8dev: Add support for USB2CAN interface from 8 devices") Cc: stable <[email protected]> # 3.9 Cc: Bernd Krumboeck <[email protected]> Cc: Wolfgang Grandegger <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
Diffstat (limited to 'drivers/net/can/usb/usb_8dev.c')
-rw-r--r--drivers/net/can/usb/usb_8dev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c
index d596a2ad7f78..8fa224b28218 100644
--- a/drivers/net/can/usb/usb_8dev.c
+++ b/drivers/net/can/usb/usb_8dev.c
@@ -996,9 +996,8 @@ static void usb_8dev_disconnect(struct usb_interface *intf)
netdev_info(priv->netdev, "device disconnected\n");
unregister_netdev(priv->netdev);
- free_candev(priv->netdev);
-
unlink_all_urbs(priv);
+ free_candev(priv->netdev);
}
}