aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-sched.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-11-08 10:17:01 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-11 21:10:45 -0500
commit2656a9abcf1ec8dd5fee6a75d6997a0f2fa0094e (patch)
tree4b16a46e185f001f530c0ba1315371d53d165044 /drivers/usb/host/ehci-sched.c
parent1b36810e27a9791878e4694357ab6d4c06acc22d (diff)
USB: EHCI: bugfix: urb->hcpriv should not be NULL
This patch (as1632b) fixes a bug in ehci-hcd. The USB core uses urb->hcpriv to determine whether or not an URB is active; host controller drivers are supposed to set this pointer to a non-NULL value when an URB is queued. However ehci-hcd sets it to NULL for isochronous URBs, which defeats the check in usbcore. In itself this isn't a big deal. But people have recently found that certain sequences of actions will cause the snd-usb-audio driver to reuse URBs without waiting for them to complete. In the absence of proper checking by usbcore, the URBs get added to their endpoint list twice. This leads to list corruption and a system freeze. The patch makes ehci-hcd assign a meaningful value to urb->hcpriv for isochronous URBs. Improving robustness always helps. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Artem S. Tashkinov <t.artem@lycos.com> Reported-by: Christof Meerwald <cmeerw@cmeerw.org> CC: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-sched.c')
-rw-r--r--drivers/usb/host/ehci-sched.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 2e14714b359f..69ebee73c0c1 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1630,7 +1630,7 @@ static void itd_link_urb(
1630 1630
1631 /* don't need that schedule data any more */ 1631 /* don't need that schedule data any more */
1632 iso_sched_free (stream, iso_sched); 1632 iso_sched_free (stream, iso_sched);
1633 urb->hcpriv = NULL; 1633 urb->hcpriv = stream;
1634 1634
1635 ++ehci->isoc_count; 1635 ++ehci->isoc_count;
1636 enable_periodic(ehci); 1636 enable_periodic(ehci);
@@ -2029,7 +2029,7 @@ static void sitd_link_urb(
2029 2029
2030 /* don't need that schedule data any more */ 2030 /* don't need that schedule data any more */
2031 iso_sched_free (stream, sched); 2031 iso_sched_free (stream, sched);
2032 urb->hcpriv = NULL; 2032 urb->hcpriv = stream;
2033 2033
2034 ++ehci->isoc_count; 2034 ++ehci->isoc_count;
2035 enable_periodic(ehci); 2035 enable_periodic(ehci);