netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] usbnet: don't clear urb->dev in tx_complete
@ 2012-03-22 13:22 Ming Lei
  2012-03-22 14:36 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Ming Lei @ 2012-03-22 13:22 UTC (permalink / raw)
  To: David S. Miller, Greg Kroah-Hartman
  Cc: netdev, linux-usb, Ming Lei, stable, Alan Stern, Oliver Neukum

URB unlinking is always racing with its completion and tx_complete
may be called before or during running usb_unlink_urb, so tx_complete
must not clear urb->dev since it will be used in unlink path,
otherwise invalid memory accesses or usb device leak may be caused
inside usb_unlink_urb.

Cc: stable@kernel.org
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 drivers/net/usb/usbnet.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index febfdce..62f8b5c 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1037,7 +1037,6 @@ static void tx_complete (struct urb *urb)
 	}
 
 	usb_autopm_put_interface_async(dev->intf);
-	urb->dev = NULL;
 	entry->state = tx_done;
 	defer_bh(dev, skb, &dev->txq);
 }
-- 
1.7.9.1

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

end of thread, other threads:[~2012-03-22 23:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-22 13:22 [PATCH 2/2] usbnet: don't clear urb->dev in tx_complete Ming Lei
2012-03-22 14:36 ` Greg Kroah-Hartman
     [not found]   ` <20120322143607.GD19835-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-03-22 23:33     ` David Miller

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