提交 b956d411 编写于 作者: R Roel Kluin 提交者: David S. Miller

sunlance: Beyond ARRAY_SIZE of ib->btx_ring

Do not go beyond ARRAY_SIZE of ib->btx_ring
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d13c11f6
...@@ -343,7 +343,7 @@ static void lance_init_ring_dvma(struct net_device *dev) ...@@ -343,7 +343,7 @@ static void lance_init_ring_dvma(struct net_device *dev)
ib->phys_addr [5] = dev->dev_addr [4]; ib->phys_addr [5] = dev->dev_addr [4];
/* Setup the Tx ring entries */ /* 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)); leptr = LANCE_ADDR(aib + libbuff_offset(tx_buf, i));
ib->btx_ring [i].tmd0 = leptr; ib->btx_ring [i].tmd0 = leptr;
ib->btx_ring [i].tmd1_hadr = leptr >> 16; ib->btx_ring [i].tmd1_hadr = leptr >> 16;
...@@ -399,7 +399,7 @@ static void lance_init_ring_pio(struct net_device *dev) ...@@ -399,7 +399,7 @@ static void lance_init_ring_pio(struct net_device *dev)
sbus_writeb(dev->dev_addr[4], &ib->phys_addr[5]); sbus_writeb(dev->dev_addr[4], &ib->phys_addr[5]);
/* Setup the Tx ring entries */ /* Setup the Tx ring entries */
for (i = 0; i <= TX_RING_SIZE; i++) { for (i = 0; i < TX_RING_SIZE; i++) {
leptr = libbuff_offset(tx_buf, i); leptr = libbuff_offset(tx_buf, i);
sbus_writew(leptr, &ib->btx_ring [i].tmd0); sbus_writew(leptr, &ib->btx_ring [i].tmd0);
sbus_writeb(leptr >> 16,&ib->btx_ring [i].tmd1_hadr); sbus_writeb(leptr >> 16,&ib->btx_ring [i].tmd1_hadr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册