diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-08-18 14:12:06 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-18 10:58:33 -0700 |
commit | a120d9ab65354727559b9db75ded8071b7ef19e2 (patch) | |
tree | adf2dd18549834743e6e0d8ec8f805b56def2ac1 /drivers/net/ethernet/qlogic | |
parent | eac2c68d663effb077210218788952b5a0c1f60e (diff) | |
download | linux-a120d9ab65354727559b9db75ded8071b7ef19e2.tar.bz2 |
netxen: fix incorrect loop counter decrement
The loop counter k is currently being decremented from zero which
is incorrect. Fix this by incrementing k instead
Detected by CoverityScan, CID#401847 ("Infinite loop")
Fixes: 83f18a557c6d ("netxen_nic: fw dump support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic')
-rw-r--r-- | drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c index 66ff15d08bad..0a66389c06c2 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c @@ -2311,7 +2311,7 @@ netxen_md_rdqueue(struct netxen_adapter *adapter, loop_cnt++) { NX_WR_DUMP_REG(select_addr, adapter->ahw.pci_base0, queue_id); read_addr = queueEntry->read_addr; - for (k = 0; k < read_cnt; k--) { + for (k = 0; k < read_cnt; k++) { NX_RD_DUMP_REG(read_addr, adapter->ahw.pci_base0, &read_value); *data_buff++ = read_value; |