DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/ice: null field checks in ice_{r,t}x_queue_release
@ 2022-10-12 12:27 Markus Theil
  2022-10-13  3:39 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Theil @ 2022-10-12 12:27 UTC (permalink / raw)
  To: dev; +Cc: Qiming Yang, Qi Zhang, Tomasz Jonak

From: Tomasz Jonak <tomasz@graphiant.com>

In case rte_eth_dma_zone_reserve fails in ice_tx_queue_setup
ice_tx_queue_release is called on 0 allocated but not initialized
txq struct.
This may happen on ENOMEM condition, size exhaustion of
memconfig->memzones array as well as some others.

Signed-off-by: Tomasz Jonak <tomasz@graphiant.com>
---
 drivers/net/ice/ice_rxtx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 697251c603..953ff217df 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -1302,7 +1302,8 @@ ice_rx_queue_release(void *rxq)
 		return;
 	}
 
-	q->rx_rel_mbufs(q);
+	if (q->rx_rel_mbufs != NULL)
+		q->rx_rel_mbufs(q);
 	rte_free(q->sw_ring);
 	rte_memzone_free(q->mz);
 	rte_free(q);
@@ -1512,7 +1513,8 @@ ice_tx_queue_release(void *txq)
 		return;
 	}
 
-	q->tx_rel_mbufs(q);
+	if (q->tx_rel_mbufs != NULL)
+		q->tx_rel_mbufs(q);
 	rte_free(q->sw_ring);
 	rte_memzone_free(q->mz);
 	rte_free(q);
-- 
2.38.0


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

end of thread, other threads:[~2022-10-13  3:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12 12:27 [PATCH] net/ice: null field checks in ice_{r,t}x_queue_release Markus Theil
2022-10-13  3:39 ` 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).