]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: ll_temac: Fix iommu/swiotlb leak
authorEsben Haabendal <esben@geanix.com>
Tue, 30 Apr 2019 07:17:55 +0000 (09:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 May 2019 18:33:30 +0000 (14:33 -0400)
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>
drivers/net/ethernet/xilinx/ll_temac_main.c

index d3899e7efd453f0c6c64bd684e28e0be1a9a820a..7e42746f2292dc637331ec6fb7af7e339fe3eb33 100644 (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);