From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 26A70A00C4; Wed, 12 Oct 2022 14:28:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C8B443049; Wed, 12 Oct 2022 14:28:02 +0200 (CEST) Received: from smail.rz.tu-ilmenau.de (smail.rz.tu-ilmenau.de [141.24.186.67]) by mails.dpdk.org (Postfix) with ESMTP id 5B9E542EF7 for ; Wed, 12 Oct 2022 14:28:01 +0200 (CEST) Received: from localhost.localdomain (dialin-ip-23-165.ilmenau.net [80.88.23.165]) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPA id EE2E7580083; Wed, 12 Oct 2022 14:28:00 +0200 (CEST) From: Markus Theil To: dev@dpdk.org Cc: Qiming Yang , Qi Zhang , Tomasz Jonak Subject: [PATCH] net/ice: null field checks in ice_{r,t}x_queue_release Date: Wed, 12 Oct 2022 14:27:57 +0200 Message-Id: <20221012122757.50488-1-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Tomasz Jonak 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 --- 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