Skip to content

Commit

Permalink
net/bnxt: fix mbuf free when clearing Tx queue
Browse files Browse the repository at this point in the history
[ upstream commit 0093267 ]

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: 6eb3cc2 ("net/bnxt: add initial Tx code")

Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
  • Loading branch information
Lance Richardson authored and kevintraynor committed Dec 9, 2019
1 parent 2b48c83 commit 34afffb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/bnxt/bnxt_txq.c
Expand Up @@ -35,7 +35,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;
}
}
Expand Down

0 comments on commit 34afffb

Please sign in to comment.