Skip to content

Commit

Permalink
can: usb_8dev: Fix memory leak in usb_8dev_start_xmit
Browse files Browse the repository at this point in the history
Fixed a memory leak when an error occurred in the transmit function. In the
error handling the urb wasn't freed before returning. There was also a call to
the usb_unanchor_urb() function but the urb wasn't anchored.

Signed-off-by: Bjorn Van Tilt <bjorn.vantilt@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Bjorn Van Tilt authored and Marc Kleine-Budde committed Apr 1, 2014
1 parent 17e84a9 commit 636d037
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/can/usb/usb_8dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,8 @@ static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb,
return NETDEV_TX_OK;

nofreecontext:
usb_unanchor_urb(urb);
usb_free_coherent(priv->udev, size, buf, urb->transfer_dma);
usb_free_urb(urb);

netdev_warn(netdev, "couldn't find free context");

Expand Down

0 comments on commit 636d037

Please sign in to comment.