Commit f89682bb authored by Jimmy Assarsson's avatar Jimmy Assarsson Committed by Greg Kroah-Hartman

can: kvaser_usb: free buf in error paths

commit 435019b4 upstream.

The allocated buffer was not freed if usb_submit_urb() failed.
Signed-off-by: default avatarJimmy Assarsson <jimmyassarsson@gmail.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6a3a7138
...@@ -813,6 +813,7 @@ static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv, ...@@ -813,6 +813,7 @@ static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv,
if (err) { if (err) {
netdev_err(netdev, "Error transmitting URB\n"); netdev_err(netdev, "Error transmitting URB\n");
usb_unanchor_urb(urb); usb_unanchor_urb(urb);
kfree(buf);
usb_free_urb(urb); usb_free_urb(urb);
return err; return err;
} }
...@@ -1768,6 +1769,7 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, ...@@ -1768,6 +1769,7 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb,
spin_unlock_irqrestore(&priv->tx_contexts_lock, flags); spin_unlock_irqrestore(&priv->tx_contexts_lock, flags);
usb_unanchor_urb(urb); usb_unanchor_urb(urb);
kfree(buf);
stats->tx_dropped++; stats->tx_dropped++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment