Skip to content

Commit

Permalink
tg3: Fix DMA mapping leak in tigon3_dma_hwbug_workaround().
Browse files Browse the repository at this point in the history
Noticed by Michael Chan.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 11, 2008
1 parent 90079ce commit 638266f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 638266f

Please sign in to comment.