diff options
author | Esben Haabendal <esben@geanix.com> | 2019-04-30 09:17:55 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-01 14:33:30 -0400 |
commit | a8c9bd3ba84084b6cca704d5b21ee0ba971b748b (patch) | |
tree | fa6c927b9bece67c46cc39fa6bc8ebe246563da7 | |
parent | f14f5c11f051ca4a41e65017d94408e5e702ba9d (diff) | |
download | linux-a8c9bd3ba84084b6cca704d5b21ee0ba971b748b.tar.gz linux-a8c9bd3ba84084b6cca704d5b21ee0ba971b748b.tar.bz2 linux-a8c9bd3ba84084b6cca704d5b21ee0ba971b748b.zip |
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>
-rw-r--r-- | drivers/net/ethernet/xilinx/ll_temac_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index d3899e7efd45..7e42746f2292 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -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); |