summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/usb/usb_8dev.c
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2013-07-17 23:20:33 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2013-07-19 14:55:14 +0200
commit7671986839f9207f8d76e8ef92b2d3f263a794cc (patch)
tree5db2bcca46a20f9f0c7205bb6c1932827dcb752b /drivers/net/can/usb/usb_8dev.c
parentnet: can: esd_usb2: check index of array before accessing (diff)
downloadlinux-7671986839f9207f8d76e8ef92b2d3f263a794cc.tar.xz
linux-7671986839f9207f8d76e8ef92b2d3f263a794cc.zip
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>
Diffstat (limited to 'drivers/net/can/usb/usb_8dev.c')
-rw-r--r--drivers/net/can/usb/usb_8dev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c
index cbd388eea682..8becd3d838b5 100644
--- a/drivers/net/can/usb/usb_8dev.c
+++ b/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;
}