Skip to content

Commit

Permalink
can: gs_usb: gs_can_open(): prevent memory leak
Browse files Browse the repository at this point in the history
In gs_can_open() if usb_submit_urb() fails the allocated urb should be
released.

Fixes: d08e973 ("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>
  • Loading branch information
Navidem authored and marckleinebudde committed Nov 4, 2019
1 parent db9ee38 commit fb5be6a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/can/usb/gs_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ static int gs_can_open(struct net_device *netdev)
rc);

usb_unanchor_urb(urb);
usb_free_urb(urb);
break;
}

Expand Down

0 comments on commit fb5be6a

Please sign in to comment.