netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: gs_usb: prevent memory leak
@ 2019-09-20  2:44 Navid Emamdoost
  2019-10-01 20:23 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Navid Emamdoost @ 2019-09-20  2:44 UTC (permalink / raw)
  Cc: emamd001, smccaman, kjlu, Navid Emamdoost, Wolfgang Grandegger,
	Marc Kleine-Budde, David S. Miller, Greg Kroah-Hartman,
	Alexios Zavras, Allison Randal, Thomas Gleixner, linux-can,
	netdev, linux-kernel

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

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 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.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] can: gs_usb: prevent memory leak
  2019-09-20  2:44 [PATCH] can: gs_usb: prevent memory leak Navid Emamdoost
@ 2019-10-01 20:23 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2019-10-01 20:23 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: emamd001, smccaman, kjlu, Wolfgang Grandegger, David S. Miller,
	Greg Kroah-Hartman, Alexios Zavras, Allison Randal,
	Thomas Gleixner, linux-can, netdev, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 609 bytes --]

On 9/20/19 4:44 AM, Navid Emamdoost wrote:
> In gs_can_open if usb_submit_urb fails the allocated urb should be
> released.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> ---
>  drivers/net/can/usb/gs_usb.c | 1 +
>  1 file changed, 1 insertion(+)

Added Fixes line and added stable@v.k.o on Cc.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-02  6:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20  2:44 [PATCH] can: gs_usb: prevent memory leak Navid Emamdoost
2019-10-01 20:23 ` Marc Kleine-Budde

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).