diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/xhci.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 196e0181b2ed..48706c0d6577 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -2386,10 +2386,18 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
2386 | /* Everything but endpoint 0 is disabled, so free or cache the rings. */ | 2386 | /* Everything but endpoint 0 is disabled, so free or cache the rings. */ |
2387 | last_freed_endpoint = 1; | 2387 | last_freed_endpoint = 1; |
2388 | for (i = 1; i < 31; ++i) { | 2388 | for (i = 1; i < 31; ++i) { |
2389 | if (!virt_dev->eps[i].ring) | 2389 | struct xhci_virt_ep *ep = &virt_dev->eps[i]; |
2390 | continue; | 2390 | |
2391 | xhci_free_or_cache_endpoint_ring(xhci, virt_dev, i); | 2391 | if (ep->ep_state & EP_HAS_STREAMS) { |
2392 | last_freed_endpoint = i; | 2392 | xhci_free_stream_info(xhci, ep->stream_info); |
2393 | ep->stream_info = NULL; | ||
2394 | ep->ep_state &= ~EP_HAS_STREAMS; | ||
2395 | } | ||
2396 | |||
2397 | if (ep->ring) { | ||
2398 | xhci_free_or_cache_endpoint_ring(xhci, virt_dev, i); | ||
2399 | last_freed_endpoint = i; | ||
2400 | } | ||
2393 | } | 2401 | } |
2394 | xhci_dbg(xhci, "Output context after successful reset device cmd:\n"); | 2402 | xhci_dbg(xhci, "Output context after successful reset device cmd:\n"); |
2395 | xhci_dbg_ctx(xhci, virt_dev->out_ctx, last_freed_endpoint); | 2403 | xhci_dbg_ctx(xhci, virt_dev->out_ctx, last_freed_endpoint); |