From: tom.leiming@gmail.com Date: Thu, 22 Mar 2012 03:22:38 +0000 (+0000) Subject: usbnet: don't clear urb->dev in tx_complete X-Git-Tag: v3.2.14~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f68ac2aaf52ed31f7d97a6542571f0f7efd7d2e;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git usbnet: don't clear urb->dev in tx_complete commit 5d5440a835710d09f0ef18da5000541ec98b537a upstream. 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: Alan Stern Cc: Oliver Neukum Signed-off-by: Ming Lei Acked-by: Greg Kroah-Hartman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index cf6a515..750e330 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); }