diff options
author | Jimmy Assarsson <jimmyassarsson@gmail.com> | 2017-11-21 08:22:26 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-16 10:33:47 +0100 |
commit | b6fa54c18e8d9060ed666ec0a597efbb8698fc7c (patch) | |
tree | a8a2d95d89a2676e314bafe834fb9c70eeedc94b /drivers | |
parent | a68e3c90dfb169af592849066c43d6e003e61bc4 (diff) | |
download | linux-stable-b6fa54c18e8d9060ed666ec0a597efbb8698fc7c.tar.gz linux-stable-b6fa54c18e8d9060ed666ec0a597efbb8698fc7c.tar.bz2 linux-stable-b6fa54c18e8d9060ed666ec0a597efbb8698fc7c.zip |
can: kvaser_usb: free buf in error paths
commit 435019b48033138581a6171093b181fc6b4d3d30 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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/can/usb/kvaser_usb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c index c2e2821a3346..8b95c98b226f 100644 --- a/drivers/net/can/usb/kvaser_usb.c +++ b/drivers/net/can/usb/kvaser_usb.c @@ -809,6 +809,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; } @@ -1767,6 +1768,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++; |