qlcnic: fix a loop exit condition better
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 24 Dec 2015 09:21:22 +0000 (12:21 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Dec 2015 16:02:35 +0000 (11:02 -0500)
In the original code, if we succeeded on the last iteration through the
loop then we still returned failure.

Fixes: 389e4e04ad2d ('qlcnic: fix a timeout loop')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c

index b1a452f291ee229866aae5d051385272e17e40dc..34906750b7e7091f5af122be88c659fd1c77f2e1 100644 (file)
@@ -252,7 +252,7 @@ int qlcnic_83xx_check_vnic_state(struct qlcnic_adapter *adapter)
                state = QLCRDX(ahw, QLC_83XX_VNIC_STATE);
        }
 
-       if (!idc->vnic_wait_limit) {
+       if (state != QLCNIC_DEV_NPAR_OPER) {
                dev_err(&adapter->pdev->dev,
                        "vNIC mode not operational, state check timed out.\n");
                return -EIO;