summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorNavid Emamdoost <navid.emamdoost@gmail.com>2019-09-19 21:44:38 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-12 19:13:23 +0100
commit7f18860337d74fdf79e7152bee7117d945ff6945 (patch)
tree4cce4360ccb67907393eef91cc41b50d97a4661a /drivers/net
parentc41a025d641156a5694a7669af9efaf4fe7dea2a (diff)
can: gs_usb: gs_can_open(): prevent memory leak
commit fb5be6a7b4863ecc44963bb80ca614584b6c7817 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net')
-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 b227f81e4a7e..6982ab8777b7 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -617,6 +617,7 @@ static int gs_can_open(struct net_device *netdev)
rc);
usb_unanchor_urb(urb);
+ usb_free_urb(urb);
break;
}