summaryrefslogtreecommitdiffstats
path: root/drivers/net/can
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2014-05-21 10:06:02 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2014-05-21 13:04:20 +0200
commitcf68f517c5c5041e3f3de502dccb008ec21f7262 (patch)
tree310db45268278f61b05384f9b78f4ad105ef2417 /drivers/net/can
parentMerge tag 'linux-can-next-for-3.16-20140519' of git://gitorious.org/linux-can... (diff)
downloadlinux-cf68f517c5c5041e3f3de502dccb008ec21f7262.tar.xz
linux-cf68f517c5c5041e3f3de502dccb008ec21f7262.zip
can: gs_usb: gs_destroy_candev(): fix use after free
This patch fixes a use after free of "dev" in gs_destroy_candev(). Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/usb/gs_usb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index c9f1f99682b1..04b0f84612f0 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -826,8 +826,8 @@ static void gs_destroy_candev(struct gs_can *dev)
{
unregister_candev(dev->netdev);
free_candev(dev->netdev);
- kfree(dev);
usb_kill_anchored_urbs(&dev->tx_submitted);
+ kfree(dev);
}
static int gs_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)