Commit 37597394 authored by Johan Hovold's avatar Johan Hovold Committed by Marc Kleine-Budde

can: usb_8dev: fix use-after-free on disconnect

The driver was accessing its driver data after having freed it.

Fixes: 0024d8ad ("can: usb_8dev: Add support for USB2CAN interface from 8 devices")
Cc: stable <stable@vger.kernel.org>     # 3.9
Cc: Bernd Krumboeck <b.krumboeck@gmail.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 4d663649
...@@ -996,9 +996,8 @@ static void usb_8dev_disconnect(struct usb_interface *intf) ...@@ -996,9 +996,8 @@ static void usb_8dev_disconnect(struct usb_interface *intf)
netdev_info(priv->netdev, "device disconnected\n"); netdev_info(priv->netdev, "device disconnected\n");
unregister_netdev(priv->netdev); unregister_netdev(priv->netdev);
free_candev(priv->netdev);
unlink_all_urbs(priv); unlink_all_urbs(priv);
free_candev(priv->netdev);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment