Explorar o código

can: usb_8dev: fix urb leak on failure path in usb_8dev_start()

If usb_8dev_start() fails to submit urb,
it unanchors the urb but forgets to free it.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Alexey Khoroshilov %!s(int64=12) %!d(string=hai) anos
pai
achega
7671986839
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      drivers/net/can/usb/usb_8dev.c

+ 1 - 0
drivers/net/can/usb/usb_8dev.c

@@ -779,6 +779,7 @@ static int usb_8dev_start(struct usb_8dev_priv *priv)
 			usb_unanchor_urb(urb);
 			usb_free_coherent(priv->udev, RX_BUFFER_SIZE, buf,
 					  urb->transfer_dma);
+			usb_free_urb(urb);
 			break;
 		}