stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org, linux-can <linux-can@vger.kernel.org>
Cc: davem@davemloft.net, kernel@pengutronix.de,
	jhofstee@victronenergy.com,
	"Martin Hundebøll" <martin@geanix.com>,
	"Kurt Van Dijck" <dev.kurt@vandijck-laurijssen.be>,
	"Navid Emamdoost" <navid.emamdoost@gmail.com>,
	linux-stable <stable@vger.kernel.org>,
	"Marc Kleine-Budde" <mkl@pengutronix.de>
Subject: [PATCH 02/29] can: gs_usb: gs_can_open(): prevent memory leak
Date: Thu, 10 Oct 2019 14:17:23 +0200	[thread overview]
Message-ID: <20191010121750.27237-3-mkl@pengutronix.de> (raw)
In-Reply-To: <20191010121750.27237-1-mkl@pengutronix.de>

From: Navid Emamdoost <navid.emamdoost@gmail.com>

In gs_can_open() if usb_submit_urb() fails the allocated urb should be
released.

Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices")
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/usb/gs_usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index bd6eb9967630..2f74f6704c12 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -623,6 +623,7 @@ static int gs_can_open(struct net_device *netdev)
 					   rc);
 
 				usb_unanchor_urb(urb);
+				usb_free_urb(urb);
 				break;
 			}
 
-- 
2.23.0


  parent reply	other threads:[~2019-10-10 12:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191010121750.27237-1-mkl@pengutronix.de>
2019-10-10 12:17 ` [PATCH 01/29] can: dev: add missing of_node_put() after calling of_get_child_by_name() Marc Kleine-Budde
2019-10-10 12:17 ` Marc Kleine-Budde [this message]
2019-10-10 12:17 ` [PATCH 03/29] can: mcba_usb: fix use-after-free on disconnect Marc Kleine-Budde
2019-10-10 12:17 ` [PATCH 04/29] can: usb_8dev: " Marc Kleine-Budde
2019-10-10 12:17 ` [PATCH 05/29] can: flexcan: disable completely the ECC mechanism Marc Kleine-Budde
2019-10-10 12:17 ` [PATCH 06/29] can: peak_usb: fix a potential out-of-sync while decoding packets Marc Kleine-Budde
2019-10-10 12:17 ` [PATCH 08/29] can: c_can: c_can_poll(): only read status register after status IRQ Marc Kleine-Budde
2019-10-10 12:17 ` [PATCH 12/29] can: rx-offload: can_rx_offload_queue_sorted(): fix error handling, avoid skb mem leak Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191010121750.27237-3-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=dev.kurt@vandijck-laurijssen.be \
    --cc=jhofstee@victronenergy.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=martin@geanix.com \
    --cc=navid.emamdoost@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).