Skip to content

Commit 6dceaa9

Browse files
Sebastian Andrzej Siewiorkuba-moo
authored andcommitted
atm: nicstar: Unmap DMA on send error
The `skb' is mapped for DMA in ns_send() but does not unmap DMA in case push_scqe() fails to submit the `skb'. The memory of the `skb' is released so only the DMA mapping is leaking. Unmap the DMA mapping in case push_scqe() failed. Fixes: 864a3ff ("atm: [nicstar] remove virt_to_bus() and support 64-bit platforms") Cc: Chas Williams <3chas3@gmail.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent d8c1901 commit 6dceaa9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/atm/nicstar.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,8 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb)
17061706

17071707
if (push_scqe(card, vc, scq, &scqe, skb) != 0) {
17081708
atomic_inc(&vcc->stats->tx_err);
1709+
dma_unmap_single(&card->pcidev->dev, NS_PRV_DMA(skb), skb->len,
1710+
DMA_TO_DEVICE);
17091711
dev_kfree_skb_any(skb);
17101712
return -EIO;
17111713
}

0 commit comments

Comments
 (0)