Skip to contentSkip to conversation

Fix buglets in mpc5200 FEC code that are corrupting memory.

PATCH New Grant Likely 1 participant 1 message Dec 2, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix buglets in mpc5200 FEC code that are corrupting memory.

From: Jon Smirl <[email protected]>

This is the reason I couldn't get user space started or connect to my nfs server. Patch is against current linus git.

mpc5200 fec driver is corrupting memory. This patch fixes two bugs where the wrong skb buffer was being referenced.

---

Jeff, this one hasn't been picked up for 2.6.24 yet and in needs to go in.

Thanks,
g.

 drivers/net/fec_mpc52xx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/fec_mpc52xx.c +2 -2
index a8a0ee2..ddfcc0b 100644
@@ -422,7 +422,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
 
 		rskb = bcom_retrieve_buffer(priv->rx_dmatsk, &status,
 				(struct bcom_bd **)&bd);
-		dma_unmap_single(&dev->dev, bd->skb_pa, skb->len, DMA_FROM_DEVICE);
+		dma_unmap_single(&dev->dev, bd->skb_pa, rskb->len, DMA_FROM_DEVICE);
 
 		/* Test for errors in received frame */
 		if (status & BCOM_FEC_RX_BD_ERRORS) {
@@ -467,7 +467,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
 			bcom_prepare_next_buffer(priv->rx_dmatsk);
 
 		bd->status = FEC_RX_BUFFER_SIZE;
-		bd->skb_pa = dma_map_single(&dev->dev, rskb->data,
+		bd->skb_pa = dma_map_single(&dev->dev, skb->data,
 				FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
 
 		bcom_submit_next_buffer(priv->rx_dmatsk, skb);