IB/ipath: iterate over correct number of ports during reset
[firefly-linux-kernel-4.4.55.git] / drivers / infiniband / hw / ipath / ipath_driver.c
index 7ff95b72d1fc93e97ab6083f1be09bcbd97cd835..398add4d4cb1f4a7a5d0a7923b8bf6ce23bc8da5 100644 (file)
@@ -1959,7 +1959,7 @@ int ipath_reset_device(int unit)
        }
 
        if (dd->ipath_pd)
-               for (i = 1; i < dd->ipath_portcnt; i++) {
+               for (i = 1; i < dd->ipath_cfgports; i++) {
                        if (dd->ipath_pd[i] && dd->ipath_pd[i]->port_cnt) {
                                ipath_dbg("unit %u port %d is in use "
                                          "(PID %u cmd %s), can't reset\n",