Skip to contentSkip to conversation

can: wrong index used in inner loop

PATCH In review roel 3 participants 3 messages Mar 8, 2011 – Mar 15, 2011

Subsystems (3)
lore
Share & tools
lore

roel

author
#0 lore raw

PATCH 1/1 can: wrong index used in inner loop

Index i was already used in the outer loop.

---
 drivers/net/can/usb/esd_usb2.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/can/usb/esd_usb2.c +3 -3
index 05a5275..dc53c83 100644
@@ -659,7 +659,7 @@ failed:
 static void unlink_all_urbs(struct esd_usb2 *dev)
 {
 	struct esd_usb2_net_priv *priv;
-	int i;
+	int i, j;
 
 	usb_kill_anchored_urbs(&dev->rx_submitted);
 	for (i = 0; i < dev->net_count; i++) {
@@ -668,8 +668,8 @@ static void unlink_all_urbs(struct esd_usb2 *dev)
 			usb_kill_anchored_urbs(&priv->tx_submitted);
 			atomic_set(&priv->active_tx_jobs, 0);
 
-			for (i = 0; i < MAX_TX_URBS; i++)
-				priv->tx_contexts[i].echo_index = MAX_TX_URBS;
+			for (j = 0; j < MAX_TX_URBS; j++)
+				priv->tx_contexts[j].echo_index = MAX_TX_URBS;
 		}
 	}
 }
maintainer
#1 lore raw

From: roel <[email protected]>
Date: Tue, 08 Mar 2011 20:52:55 +0100

Quoted 3 lines

Index i was already used in the outer loop.

CAN maintainers, could you please review and ACK patches in a timely manner, especially utterly trivial bug fixes like this one here?

That's largely what I've been waiting for, a simple sign of life from the listed maintainers for these files.

Anyways, no use waiting any longer, applied, thanks Roel.

#2 lore raw
Quoted 5 lines · David Miller

From: roel <[email protected]>
Date: Tue, 08 Mar 2011 20:52:55 +0100

Quoted 2 lines

Index i was already used in the outer loop.

Quoted 7 lines
Quoted 1 line

CAN maintainers, could you please review and ACK patches in a timely manner,
especially utterly trivial bug fixes like this one here?

That's largely what I've been waiting for, a simple sign of life from

the

Quoted 1 line

listed maintainers for these files.

OK, will try to react fast next time.

Quoted 1 line

Anyways, no use waiting any longer, applied, thanks Roel.

Thanks,

Wolfgang.