Patchwork X:beyond ARRAY_SIZE of ib->btx_ring

login
register
mail settings
Submitter roel kluin
Date May 21, 2009, 8:28 p.m.
Message ID <4A15B95D.4050200@gmail.com>
Download mbox | patch
Permalink /patch/27499/
State Superseded
Delegated to: David Miller
Headers show

Comments

roel kluin - May 21, 2009, 8:28 p.m.
Do not go beyond ARRAY_SIZE of ib->btx_ring

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 704301a..aa2a4ef 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -343,7 +343,7 @@  static void lance_init_ring_dvma(struct net_device *dev)
 	ib->phys_addr [5] = dev->dev_addr [4];
 
 	/* Setup the Tx ring entries */
-	for (i = 0; i <= TX_RING_SIZE; i++) {
+	for (i = 0; i < TX_RING_SIZE; i++) {
 		leptr = LANCE_ADDR(aib + libbuff_offset(tx_buf, i));
 		ib->btx_ring [i].tmd0      = leptr;
 		ib->btx_ring [i].tmd1_hadr = leptr >> 16;