diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-12-15 11:52:36 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-12-15 18:46:03 +0100 |
commit | 351434c6ba92e1fe7799a0c33c1412584a0fb3de (patch) | |
tree | f0d7379e8c1ac78f506c390e378704aeb8d04ead /drivers/net/ethernet/qlogic | |
parent | amd-xgbe: fix a couple timeout loops (diff) | |
download | linux-351434c6ba92e1fe7799a0c33c1412584a0fb3de.tar.xz linux-351434c6ba92e1fe7799a0c33c1412584a0fb3de.zip |
qlge: fix a timeout loop in ql_change_rx_buffers()
The problem here is that after the loop we test for "if (!i) " but
because "i--" is a post-op we exit with i set to -1. I have fixed this
by changing it to a pre-op instead. I had to change the starting value
from 3 to 4 so that we still iterate 3 times.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlge/qlge_main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index 02b7115b6aaa..997976426799 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c @@ -4211,8 +4211,9 @@ static int ql_change_rx_buffers(struct ql_adapter *qdev) /* Wait for an outstanding reset to complete. */ if (!test_bit(QL_ADAPTER_UP, &qdev->flags)) { - int i = 3; - while (i-- && !test_bit(QL_ADAPTER_UP, &qdev->flags)) { + int i = 4; + + while (--i && !test_bit(QL_ADAPTER_UP, &qdev->flags)) { netif_err(qdev, ifup, qdev->ndev, "Waiting for adapter UP...\n"); ssleep(1); |