diff options
author | Jon Smirl <jonsmirl@gmail.com> | 2007-12-03 17:38:10 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-12-04 14:53:14 -0500 |
commit | 4c537e6371a9510c82eb96fb7e1e66017e0e2053 (patch) | |
tree | 01119d2340a0d064d7e9227cd2df2711dcb7b6e1 /drivers/net | |
parent | 0581d3f53053de597ef4956568c15785e59828ef (diff) |
Fix memory corruption in fec_mpc52xx
The mpc5200 fec driver is corrupting memory. This patch fixes two bugs
where the wrong skb was being referenced.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Acked-by: Domen Puncer <domen.puncer@telargo.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/fec_mpc52xx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c index bf5a7caa5b52..79f7eade4773 100644 --- a/drivers/net/fec_mpc52xx.c +++ b/drivers/net/fec_mpc52xx.c | |||
@@ -422,7 +422,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id) | |||
422 | 422 | ||
423 | rskb = bcom_retrieve_buffer(priv->rx_dmatsk, &status, | 423 | rskb = bcom_retrieve_buffer(priv->rx_dmatsk, &status, |
424 | (struct bcom_bd **)&bd); | 424 | (struct bcom_bd **)&bd); |
425 | dma_unmap_single(&dev->dev, bd->skb_pa, skb->len, DMA_FROM_DEVICE); | 425 | dma_unmap_single(&dev->dev, bd->skb_pa, rskb->len, DMA_FROM_DEVICE); |
426 | 426 | ||
427 | /* Test for errors in received frame */ | 427 | /* Test for errors in received frame */ |
428 | if (status & BCOM_FEC_RX_BD_ERRORS) { | 428 | if (status & BCOM_FEC_RX_BD_ERRORS) { |
@@ -467,7 +467,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id) | |||
467 | bcom_prepare_next_buffer(priv->rx_dmatsk); | 467 | bcom_prepare_next_buffer(priv->rx_dmatsk); |
468 | 468 | ||
469 | bd->status = FEC_RX_BUFFER_SIZE; | 469 | bd->status = FEC_RX_BUFFER_SIZE; |
470 | bd->skb_pa = dma_map_single(&dev->dev, rskb->data, | 470 | bd->skb_pa = dma_map_single(&dev->dev, skb->data, |
471 | FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE); | 471 | FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE); |
472 | 472 | ||
473 | bcom_submit_next_buffer(priv->rx_dmatsk, skb); | 473 | bcom_submit_next_buffer(priv->rx_dmatsk, skb); |