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

* RE: [PATCH] net/ice: null field checks in ice_{r,t}x_queue_release
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2022-10-13  3:39 UTC (permalink / raw)
  To: Markus Theil, dev; +Cc: Yang, Qiming, Tomasz Jonak



> -----Original Message-----
> From: Markus Theil <markus.theil@tu-ilmenau.de>
> Sent: Wednesday, October 12, 2022 8:28 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Tomasz Jonak <tomasz@graphiant.com>
> Subject: [PATCH] net/ice: null field checks in ice_{r,t}x_queue_release
> 
> 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.
> 

Added:
Fixes: edec6dd83824 ("net/ice: remove redundant functions")
Cc: stable@dpdk.org

> Signed-off-by: Tomasz Jonak <tomasz@graphiant.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi


^ 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).