From: David S. Miller Date: Thu, 11 Sep 2008 22:45:19 +0000 (-0700) Subject: tg3: Fix DMA mapping leak in tigon3_dma_hwbug_workaround(). X-Git-Tag: v2.6.28-rc1~717^2~293 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=638266f7e879e34de4a4635049c15f5a58505e75;p=linux-2.6-omap-h63xx.git tg3: Fix DMA mapping leak in tigon3_dma_hwbug_workaround(). Noticed by Michael Chan. Signed-off-by: David S. Miller --- diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 355e8bcf6fe..123920759ef 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -4631,6 +4631,9 @@ static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, * Drop the packet if it does. */ if (ret || tg3_4g_overflow_test(new_addr, new_skb->len)) { + if (!ret) + skb_dma_unmap(&tp->pdev->dev, new_skb, + DMA_TO_DEVICE); ret = -1; dev_kfree_skb(new_skb); new_skb = NULL;