[PATCH v2 69/83] raw/cnxk_bphy: remove unnecessary NULL checks

Stephen Hemminger stephen at networkplumber.org
Mon Jan 24 18:47:05 CET 2022


Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
index 0b694e1c03c3..169cbc785531 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
@@ -233,8 +233,7 @@ cnxk_bphy_cgx_fini_queues(struct cnxk_bphy_cgx *cgx)
 	unsigned int i;
 
 	for (i = 0; i < cgx->num_queues; i++) {
-		if (cgx->queues[i].rsp)
-			rte_free(cgx->queues[i].rsp);
+		rte_free(cgx->queues[i].rsp);
 	}
 
 	cgx->num_queues = 0;
-- 
2.30.2



More information about the dev mailing list