From: Lance Richardson Date: Wed, 23 Oct 2019 14:27:35 +0000 (-0400) Subject: net/bnxt: fix mbuf free when clearing Tx queue X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=00932678c6bbbe922a2790e59fd68b34719f3171;p=dpdk.git net/bnxt: fix mbuf free when clearing Tx queue When freeing pending transmit mbufs, use rte_pktmbuf_free_seg() instead of rte_pktmbuf_free(), otherwise linked mbufs may be freed more than once. Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code") Cc: stable@dpdk.org Reviewed-by: Ajit Khaparde Signed-off-by: Lance Richardson --- diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c index ebb9199d2d..6b866d4454 100644 --- a/drivers/net/bnxt/bnxt_txq.c +++ b/drivers/net/bnxt/bnxt_txq.c @@ -34,7 +34,7 @@ static void bnxt_tx_queue_release_mbufs(struct bnxt_tx_queue *txq) if (sw_ring) { for (i = 0; i < txq->tx_ring->tx_ring_struct->ring_size; i++) { if (sw_ring[i].mbuf) { - rte_pktmbuf_free(sw_ring[i].mbuf); + rte_pktmbuf_free_seg(sw_ring[i].mbuf); sw_ring[i].mbuf = NULL; } }