From: Alexey Khoroshilov <khoroshilov@ispras.ru>
To: Wolfgang Grandegger <wg@grandegger.com>,
Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>,
Bernd Krumboeck <krumboeck@universalnet.at>,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org
Subject: [PATCH] can: usb_8dev: fix urb leak on failure path in usb_8dev_start()
Date: Thu, 18 Jul 2013 01:20:33 +0400 [thread overview]
Message-ID: <1374096033-28981-1-git-send-email-khoroshilov@ispras.ru> (raw)
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>
---
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.1.2
next reply other threads:[~2013-07-17 21:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-17 21:20 Alexey Khoroshilov [this message]
2013-07-19 12:54 ` [PATCH] can: usb_8dev: fix urb leak on failure path in usb_8dev_start() Marc Kleine-Budde
2013-07-28 7:45 ` Bernd Krumboeck
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=1374096033-28981-1-git-send-email-khoroshilov@ispras.ru \
--to=khoroshilov@ispras.ru \
--cc=krumboeck@universalnet.at \
--cc=ldv-project@linuxtesting.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=wg@grandegger.com \
/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).