net: ll_temac: Fix iommu/swiotlb leak

Unmap the actual buffer length, not the amount of data received, avoiding
resource exhaustion of swiotlb (seen on x86_64 platform).

Signed-off-by: Esben Haabendal <esben@geanix.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Esben Haabendal 2019-04-30 09:17:55 +02:00 committed by David S. Miller
parent f14f5c11f0
commit a8c9bd3ba8
1 changed files with 1 additions and 1 deletions

View File

@ -820,7 +820,7 @@ static void ll_temac_recv(struct net_device *ndev)
length = be32_to_cpu(cur_p->app4) & 0x3FFF;
dma_unmap_single(ndev->dev.parent, be32_to_cpu(cur_p->phys),
length, DMA_FROM_DEVICE);
XTE_MAX_JUMBO_FRAME_SIZE, DMA_FROM_DEVICE);
skb_put(skb, length);
skb->protocol = eth_type_trans(skb, ndev);