Skip to contentSkip to conversation

can: gs_usb: prevent memory leak

PATCH In review Navid Emamdoost 2 participants 2 messages Sep 20, 2019 – Oct 1, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: gs_usb: prevent memory leak

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

---
 drivers/net/can/usb/gs_usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/can/usb/gs_usb.c +1 -0
index bd6eb9967630..2f74f6704c12 100644
@@ -623,6 +623,7 @@ static int gs_can_open(struct net_device *netdev)
 					   rc);
 
 				usb_unanchor_urb(urb);
+				usb_free_urb(urb);
 				break;
 			}
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 7 lines · Navid Emamdoost

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

---
 drivers/net/can/usb/gs_usb.c | 1 +
 1 file changed, 1 insertion(+)

Added Fixes line and added [email protected] on Cc.

Marc

Signature · 4 lines
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   |