2019-09-20 16:31:45

by Navid Emamdoost

[permalink] [raw]
Subject: [PATCH] can: gs_usb: prevent memory leak

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

Signed-off-by: Navid Emamdoost <[email protected]>
---
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


2019-10-02 07:07:35

by Marc Kleine-Budde

[permalink] [raw]
Subject: Re: [PATCH] can: gs_usb: prevent memory leak

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 <[email protected]>
> ---
> drivers/net/can/usb/gs_usb.c | 1 +
> 1 file changed, 1 insertion(+)

Added Fixes line and added [email protected] 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 |


Attachments:
signature.asc (499.00 B)
OpenPGP digital signature