DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/iavf: fix core dump when exiting testpmd
@ 2023-10-26  8:54 Kaiwen Deng
  2023-10-31  8:15 ` Zhang, Qi Z
  2023-11-01  1:34 ` [PATCH v2] net/iavf: fix coredump " Kaiwen Deng
  0 siblings, 2 replies; 12+ messages in thread
From: Kaiwen Deng @ 2023-10-26  8:54 UTC (permalink / raw)
  To: dev
  Cc: qiming.yang, yidingx.zhou, Kaiwen Deng, Jingjing Wu, Beilei Xing,
	Wenzhuo Lu, Bruce Richardson

release null mbuf results coredump.
This commit adding mbuf check before releasing.

Fixes: 12016895fcf3 ("net/iavf: fix buffer leak on Tx queue stop")

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
---
 drivers/net/iavf/iavf_rxtx_vec_common.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx_vec_common.h b/drivers/net/iavf/iavf_rxtx_vec_common.h
index e18cdc3f11..f50a500536 100644
--- a/drivers/net/iavf/iavf_rxtx_vec_common.h
+++ b/drivers/net/iavf/iavf_rxtx_vec_common.h
@@ -187,8 +187,11 @@ _iavf_tx_queue_release_mbufs_vec(struct iavf_tx_queue *txq)
 
 	i = txq->next_dd - txq->rs_thresh + 1;
 	while (i != txq->tx_tail) {
-		rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
-		txq->sw_ring[i].mbuf = NULL;
+		if (txq->sw_ring[i].mbuf) {
+			rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);
+			txq->sw_ring[i].mbuf = NULL;
+		}
+
 		if (++i == txq->nb_tx_desc)
 			i = 0;
 	}
-- 
2.34.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-11-09 12:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-26  8:54 [PATCH] net/iavf: fix core dump when exiting testpmd Kaiwen Deng
2023-10-31  8:15 ` Zhang, Qi Z
2023-11-01  1:34 ` [PATCH v2] net/iavf: fix coredump " Kaiwen Deng
2023-11-01  7:53   ` Lu, Wenzhuo
2023-11-01  9:32     ` Deng, KaiwenX
2023-11-01 11:00   ` Zhang, Qi Z
2023-11-02  4:43   ` [PATCH v3] net/iavf: fix mbuf release API selection Kaiwen Deng
2023-11-08  9:33     ` Zhang, Qi Z
2023-11-08 12:02       ` Zhang, Qi Z
2023-11-09  1:42         ` Deng, KaiwenX
2023-11-09  4:58     ` [PATCH v4] " Kaiwen Deng
2023-11-09 12:23       ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).