aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
authorFlorian Wolter <wolly84@web.de>2013-08-14 04:33:16 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2013-09-23 18:43:31 -0400
commit526867c3ca0caa2e3e846cb993b0f961c33c2abb (patch)
treebb633ca571f7d3e0a721c2ffd7c9dd5697f7ab20 /drivers/usb/host/xhci-ring.c
parent8b3d45705e54075cfb9d4212dbca9ea82c85c4b8 (diff)
xhci: Fix race between ep halt and URB cancellation
The halted state of a endpoint cannot be cleared over CLEAR_HALT from a user process, because the stopped_td variable was overwritten in the handle_stopped_endpoint() function. So the xhci_endpoint_reset() function will refuse the reset and communication with device can not run over this endpoint. https://bugzilla.kernel.org/show_bug.cgi?id=60699 Signed-off-by: Florian Wolter <wolly84@web.de> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r--drivers/usb/host/xhci-ring.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index dd02402700d5..6bfbd80ec2b9 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -869,8 +869,12 @@ remove_finished_td:
869 /* Otherwise ring the doorbell(s) to restart queued transfers */ 869 /* Otherwise ring the doorbell(s) to restart queued transfers */
870 ring_doorbell_for_active_rings(xhci, slot_id, ep_index); 870 ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
871 } 871 }
872 ep->stopped_td = NULL; 872
873 ep->stopped_trb = NULL; 873 /* Clear stopped_td and stopped_trb if endpoint is not halted */
874 if (!(ep->ep_state & EP_HALTED)) {
875 ep->stopped_td = NULL;
876 ep->stopped_trb = NULL;
877 }
874 878
875 /* 879 /*
876 * Drop the lock and complete the URBs in the cancelled TD list. 880 * Drop the lock and complete the URBs in the cancelled TD list.