mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
can: kvaser_usb: free buf in error paths
commit 435019b480 upstream.
The allocated buffer was not freed if usb_submit_urb() failed.
Signed-off-by: Jimmy Assarsson <jimmyassarsson@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6a3a713880
commit
f89682bb3c
@@ -813,6 +813,7 @@ static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv,
|
||||
if (err) {
|
||||
netdev_err(netdev, "Error transmitting URB\n");
|
||||
usb_unanchor_urb(urb);
|
||||
kfree(buf);
|
||||
usb_free_urb(urb);
|
||||
return err;
|
||||
}
|
||||
@@ -1768,6 +1769,7 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb,
|
||||
spin_unlock_irqrestore(&priv->tx_contexts_lock, flags);
|
||||
|
||||
usb_unanchor_urb(urb);
|
||||
kfree(buf);
|
||||
|
||||
stats->tx_dropped++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user