qede: Fix XDP memory leak on unload
authorSuddarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Tue, 9 May 2017 12:07:47 +0000 (15:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 May 2017 15:24:22 +0000 (11:24 -0400)
When (re|un)loading, Tx-queues belonging to XDP would not get freed.

Fixes: cb6aeb079294 ("qede: Add support for XDP_TX")
Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qede/qede_main.c

index b9ba23d71c61a6f7cf7edc1a2ff9e5fd6e252514..263fd28648ead2403bb8a251703070fbf1673da8 100644 (file)
@@ -1313,6 +1313,9 @@ static void qede_free_mem_fp(struct qede_dev *edev, struct qede_fastpath *fp)
        if (fp->type & QEDE_FASTPATH_RX)
                qede_free_mem_rxq(edev, fp->rxq);
 
+       if (fp->type & QEDE_FASTPATH_XDP)
+               qede_free_mem_txq(edev, fp->xdp_tx);
+
        if (fp->type & QEDE_FASTPATH_TX)
                qede_free_mem_txq(edev, fp->txq);
 }