]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] powerpc/cell spidernet incorrect offset
authorLinas Vepstas <linas@austin.ibm.com>
Tue, 10 Oct 2006 21:09:40 +0000 (16:09 -0500)
committerJeff Garzik <jeff@garzik.org>
Wed, 11 Oct 2006 08:04:26 +0000 (04:04 -0400)
Bugfix -- the rx chain is in memory after the tx chain --
the offset being used was wrong, resulting in memory corruption
when the size of the rx and tx rings weren't exactly the same.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: James K Lewis <jklewis@us.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/spider_net.c

index 0eeff1add882ce3776c2534cec04015dfdca4e0a..d779a0b9d45672919db23846873192c2a7da0f75 100644 (file)
@@ -1628,8 +1628,10 @@ spider_net_open(struct net_device *netdev)
        if (spider_net_init_chain(card, &card->tx_chain, card->descr,
                        PCI_DMA_TODEVICE, card->tx_desc))
                goto alloc_tx_failed;
+
+       /* rx_chain is after tx_chain, so offset is descr + tx_count */
        if (spider_net_init_chain(card, &card->rx_chain,
-                       card->descr + card->rx_desc,
+                       card->descr + card->tx_desc,
                        PCI_DMA_FROMDEVICE, card->rx_desc))
                goto alloc_rx_failed;