summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-mem.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-11-07 08:19:45 +0100
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2014-03-05 00:38:13 +0100
commit127329d76b8534fb58c207db1f172d8468b828ff (patch)
tree407111d59016596dd5729630c9386f67fa49906d /drivers/usb/host/xhci-mem.c
parentuas: Move uas detect code to uas-detect.h (diff)
downloadlinux-127329d76b8534fb58c207db1f172d8468b828ff.tar.xz
linux-127329d76b8534fb58c207db1f172d8468b828ff.zip
xhci: xhci_mem_cleanup: make sure cmd_ring_reserved_trbs really is 0
cmd_ring_reserved_trbs gets decremented by xhci_free_stream_info(), so set it to 0 after freeing all rings, otherwise it wraps around to a very large value when rings with streams are free-ed. Before this patch the wrap-around could be triggered when xhci_resume calls xhci_mem_cleanup if the controller resume fails. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-rw-r--r--drivers/usb/host/xhci-mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index edfb31ad5949..60fc6720007f 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1812,7 +1812,6 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
if (xhci->lpm_command)
xhci_free_command(xhci, xhci->lpm_command);
- xhci->cmd_ring_reserved_trbs = 0;
if (xhci->cmd_ring)
xhci_ring_free(xhci, xhci->cmd_ring);
xhci->cmd_ring = NULL;
@@ -1877,6 +1876,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
}
no_bw:
+ xhci->cmd_ring_reserved_trbs = 0;
xhci->num_usb2_ports = 0;
xhci->num_usb3_ports = 0;
xhci->num_active_eps = 0;