diff options
author | tom.leiming@gmail.com <tom.leiming@gmail.com> | 2012-03-21 23:22:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-22 19:32:34 -0400 |
commit | 5d5440a835710d09f0ef18da5000541ec98b537a (patch) | |
tree | 3e6e9ed88b266beadbf9698c15852865acb2605a /drivers/net/usb | |
parent | 0956a8c20b23d429e79ff86d4325583fc06f9eb4 (diff) |
usbnet: don't clear urb->dev in tx_complete
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>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | 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 febfdceeb9e5..62f8b5cfbb56 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1037,7 +1037,6 @@ static void tx_complete (struct urb *urb) | |||
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | usb_autopm_put_interface_async(dev->intf); | 1039 | usb_autopm_put_interface_async(dev->intf); |
1040 | urb->dev = NULL; | ||
1041 | entry->state = tx_done; | 1040 | entry->state = tx_done; |
1042 | defer_bh(dev, skb, &dev->txq); | 1041 | defer_bh(dev, skb, &dev->txq); |
1043 | } | 1042 | } |