netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: usb_8dev: fix urb leak on failure path in usb_8dev_start()
@ 2013-07-17 21:20 Alexey Khoroshilov
  2013-07-19 12:54 ` Marc Kleine-Budde
  2013-07-28  7:45 ` Bernd Krumboeck
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Khoroshilov @ 2013-07-17 21:20 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde
  Cc: Alexey Khoroshilov, Bernd Krumboeck, linux-can, netdev,
	linux-kernel, ldv-project

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-28  7:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-17 21:20 [PATCH] can: usb_8dev: fix urb leak on failure path in usb_8dev_start() Alexey Khoroshilov
2013-07-19 12:54 ` Marc Kleine-Budde
2013-07-28  7:45 ` Bernd Krumboeck

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).