Skip to content

Commit

Permalink
can: gs_usb: gs_destroy_candev(): fix use after free
Browse files Browse the repository at this point in the history
This patch fixes a use after free of "dev" in gs_destroy_candev().

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
  • Loading branch information
marckleinebudde committed May 21, 2014
1 parent 2a7ede5 commit cf68f51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/can/usb/gs_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cf68f51

Please sign in to comment.