can: gs_usb: gs_can_open(): prevent memory leak
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Fri, 20 Sep 2019 02:44:38 +0000 (21:44 -0500)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 4 Nov 2019 20:47:20 +0000 (21:47 +0100)
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

index bd6eb99..2f74f67 100644 (file)
@@ -623,6 +623,7 @@ static int gs_can_open(struct net_device *netdev)
                                           rc);
 
                                usb_unanchor_urb(urb);
+                               usb_free_urb(urb);
                                break;
                        }