Merge tag 'v3.10.56' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / usb / host / xhci-mem.c
index 1b6a89f6037d20bcd4f17e3f5f274e8c2c917810..df94df151316a6b7c92e86c20d02c1db19f90b77 100644 (file)
@@ -1814,7 +1814,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
        }
 
        num_ports = HCS_MAX_PORTS(xhci->hcs_params1);
-       for (i = 0; i < num_ports; i++) {
+       for (i = 0; i < num_ports && xhci->rh_bw; i++) {
                struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table;
                for (j = 0; j < XHCI_MAX_INTERVAL; j++) {
                        struct list_head *ep = &bwt->interval_bw[j].endpoints;