netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netxen: fix incorrect loop counter decrement
@ 2017-08-18 13:12 Colin King
  2017-08-18 17:59 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-08-18 13:12 UTC (permalink / raw)
  To: Manish Chopra, Rahul Verma, Dept-GELinuxNICDev, netdev; +Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netxen: fix incorrect loop counter decrement
  2017-08-18 13:12 [PATCH] netxen: fix incorrect loop counter decrement Colin King
@ 2017-08-18 17:59 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-08-18 17:59 UTC (permalink / raw)
  To: colin.king
  Cc: manish.chopra, rahul.verma, Dept-GELinuxNICDev, netdev,
	linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Fri, 18 Aug 2017 14:12:06 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-18 17:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-18 13:12 [PATCH] netxen: fix incorrect loop counter decrement Colin King
2017-08-18 17:59 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).