]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qed: Fix mapping leak on LL2 rx flow
authorMintz, Yuval <Yuval.Mintz@cavium.com>
Tue, 14 Mar 2017 13:26:00 +0000 (15:26 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 26 Jul 2017 03:46:42 +0000 (20:46 -0700)
Orabug: 2593305326439680

When receiving an Rx LL2 packet, qed fails to unmap the previous buffer.

Fixes: 0a7fb11c23c0 ("qed: Add Light L2 support");
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/qlogic/qed/qed_ll2.c

index 62c6152c5a9652ae21a34b3caf7ac28470ef3234..0d7f00881076a73de99e447940afddc8e3e23ea9 100644 (file)
@@ -211,6 +211,8 @@ static void qed_ll2b_complete_rx_packet(struct qed_hwfn *p_hwfn,
        /* If need to reuse or there's no replacement buffer, repost this */
        if (rc)
                goto out_post;
+       dma_unmap_single(&cdev->pdev->dev, buffer->phys_addr,
+                        cdev->ll2->rx_size, DMA_FROM_DEVICE);
 
        skb = build_skb(buffer->data, 0);
        if (!skb) {