Commit 6f28501b authored by Alan Stern's avatar Alan Stern Committed by Sasha Levin

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: default avatarAlan Stern <stern@rowland.harvard.edu>
Reported-by: default avatarArtem S. Tashkinov <t.artem@lycos.com>
Reported-by: default avatarChristof Meerwald <cmeerw@cmeerw.org>
CC: <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 2656a9ab)
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 86b07585
......@@ -269,6 +269,9 @@ __acquires(ehci->lock)
ehci_to_hcd(ehci)->self.bandwidth_int_reqs--;
}
if (usb_pipetype(urb->pipe) != PIPE_ISOCHRONOUS)
qh_put((struct ehci_qh *) urb->hcpriv);
if (unlikely(urb->unlinked)) {
COUNT(ehci->stats.unlink);
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment