From: Linas Vepstas Date: Tue, 10 Oct 2006 21:09:40 +0000 (-0500) Subject: [PATCH] powerpc/cell spidernet incorrect offset X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b21606a773faffc2b3ec326325c433bdf37ecbdf;p=linux-beck.git [PATCH] powerpc/cell spidernet incorrect offset 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 Cc: James K Lewis Cc: Arnd Bergmann Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 0eeff1add882..d779a0b9d456 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c @@ -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;