提交 638266f7 编写于 作者: D David S. Miller

tg3: Fix DMA mapping leak in tigon3_dma_hwbug_workaround().

Noticed by Michael Chan.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 90079ce8
...@@ -4631,6 +4631,9 @@ static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, ...@@ -4631,6 +4631,9 @@ static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb,
* Drop the packet if it does. * Drop the packet if it does.
*/ */
if (ret || tg3_4g_overflow_test(new_addr, new_skb->len)) { 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; ret = -1;
dev_kfree_skb(new_skb); dev_kfree_skb(new_skb);
new_skb = NULL; new_skb = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册