Skip to content

Commit

Permalink
[PATCH] powerpc/cell spidernet incorrect offset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linas Vepstas authored and Jeff Garzik committed Oct 11, 2006
1 parent 98b9040 commit b21606a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/spider_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit b21606a

Please sign in to comment.