aboutsummaryrefslogtreecommitdiff
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
parent2a7ede540785cac631a7e7334701a25e949853a8 (diff)
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>
-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 c9f1f99682b..04b0f84612f 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)