diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-11 18:45:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-11 18:45:19 -0400 |
commit | 638266f7e879e34de4a4635049c15f5a58505e75 (patch) | |
tree | cf9aba26a0ac2f0e9efb2bd0124b57a5f7506bd8 /drivers | |
parent | 90079ce89aa65e17f36ac2b09110720c51d874f4 (diff) |
tg3: Fix DMA mapping leak in tigon3_dma_hwbug_workaround().
Noticed by Michael Chan.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/tg3.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 355e8bcf6fed..123920759efd 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, | |||
4631 | * Drop the packet if it does. | 4631 | * Drop the packet if it does. |
4632 | */ | 4632 | */ |
4633 | if (ret || tg3_4g_overflow_test(new_addr, new_skb->len)) { | 4633 | if (ret || tg3_4g_overflow_test(new_addr, new_skb->len)) { |
4634 | if (!ret) | ||
4635 | skb_dma_unmap(&tp->pdev->dev, new_skb, | ||
4636 | DMA_TO_DEVICE); | ||
4634 | ret = -1; | 4637 | ret = -1; |
4635 | dev_kfree_skb(new_skb); | 4638 | dev_kfree_skb(new_skb); |
4636 | new_skb = NULL; | 4639 | new_skb = NULL; |