From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: kernel@pengutronix.de, linux-can@vger.kernel.org,
davem@davemloft.net, Alexey Khoroshilov <khoroshilov@ispras.ru>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 2/2] can: usb_8dev: fix urb leak on failure path in usb_8dev_start()
Date: Fri, 19 Jul 2013 15:17:49 +0200 [thread overview]
Message-ID: <1374239869-27085-3-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1374239869-27085-1-git-send-email-mkl@pengutronix.de>
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
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>
---
drivers/net/can/usb/usb_8dev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c
index cbd388e..8becd3d 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;
}
--
1.8.3.1
next prev parent reply other threads:[~2013-07-19 13:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-19 13:17 pull-request: can 2013-07-19 Marc Kleine-Budde
2013-07-19 13:17 ` [PATCH 1/2] net: can: esd_usb2: check index of array before accessing Marc Kleine-Budde
2013-07-19 13:17 ` Marc Kleine-Budde [this message]
2013-07-21 0:01 ` pull-request: can 2013-07-19 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1374239869-27085-3-git-send-email-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=khoroshilov@ispras.ru \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).