diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2014-05-21 12:06:02 +0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2014-05-21 15:04:20 +0400 |
commit | cf68f517c5c5041e3f3de502dccb008ec21f7262 (patch) | |
tree | 310db45268278f61b05384f9b78f4ad105ef2417 /drivers/net/can | |
parent | 2a7ede540785cac631a7e7334701a25e949853a8 (diff) | |
download | linux-cf68f517c5c5041e3f3de502dccb008ec21f7262.tar.xz |
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.c | 2 |
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) |