aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorFlorian Wolter <wolly84@web.de>2013-08-14 04:33:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-05 10:13:11 -0400
commit27e08a9885a9dab816af72f86b92f2f3513e8314 (patch)
tree64c65fa34417777be4d1afdae2b3f959ec3dbb51 /drivers/usb/host
parentc9dd3462b3f99a4a397b7d90265c2e21831ed3a0 (diff)
xhci: Fix race between ep halt and URB cancellation
commit 526867c3ca0caa2e3e846cb993b0f961c33c2abb upstream. 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> Cc: Jonghwan Choi <jhbird.choi@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-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 21f1f13ea262..bcfb08e41eb6 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -857,8 +857,12 @@ remove_finished_td:
857 /* Otherwise ring the doorbell(s) to restart queued transfers */ 857 /* Otherwise ring the doorbell(s) to restart queued transfers */
858 ring_doorbell_for_active_rings(xhci, slot_id, ep_index); 858 ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
859 } 859 }
860 ep->stopped_td = NULL; 860
861 ep->stopped_trb = NULL; 861 /* Clear stopped_td and stopped_trb if endpoint is not halted */
862 if (!(ep->ep_state & EP_HALTED)) {
863 ep->stopped_td = NULL;
864 ep->stopped_trb = NULL;
865 }
862 866
863 /* 867 /*
864 * Drop the lock and complete the URBs in the cancelled TD list. 868 * Drop the lock and complete the URBs in the cancelled TD list.