summaryrefslogtreecommitdiff
path: root/drivers/net/can/usb
diff options
context:
space:
mode:
authorNavid Emamdoost <navid.emamdoost@gmail.com>2019-09-20 05:44:38 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2019-11-04 23:47:20 +0300
commitfb5be6a7b4863ecc44963bb80ca614584b6c7817 (patch)
treebda3705945340f42c209771ad76652ba9e8e965e /drivers/net/can/usb
parentdb9ee384f6f71f7c5296ce85b7c1a2a2527e7c72 (diff)
downloadlinux-fb5be6a7b4863ecc44963bb80ca614584b6c7817.tar.xz
can: gs_usb: gs_can_open(): prevent memory leak
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>
Diffstat (limited to 'drivers/net/can/usb')
-rw-r--r--drivers/net/can/usb/gs_usb.c1
1 files changed, 1 insertions, 0 deletions
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;
}