Patchwork [dpdk-dev,v2,04/20] net/dpaa2: fix bad check for not-null

login
register
mail settings
Submitter Shreyansh Jain
Date Jan. 11, 2019, 11:58 a.m.
Message ID <20190111115712.6482-5-shreyansh.jain@nxp.com>
Download mbox | patch
Permalink /patch/697579/
State New
Headers show

Comments

Shreyansh Jain - Jan. 11, 2019, 11:58 a.m.
From: Hemant Agrawal <hemant.agrawal@nxp.com>

The check !dpaa2->cscn is not correct to check non-null value.

Fixes: 5d9a1e4d23fe ("net/dpaa2: enhance queue memory cleanup")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa2/dpaa2_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index fa71807e6..8d4ea1bca 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -311,8 +311,7 @@  dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev)
 		/* cleanup tx queue cscn */
 		for (i = 0; i < priv->nb_tx_queues; i++) {
 			dpaa2_q = (struct dpaa2_queue *)priv->tx_vq[i];
-			if (!dpaa2_q->cscn)
-				rte_free(dpaa2_q->cscn);
+			rte_free(dpaa2_q->cscn);
 		}
 		/*free memory for all queues (RX+TX) */
 		rte_free(priv->rx_vq[0]);