diff mbox series

[62/82] net/qede: remove unnecessary NULL checks

Message ID 20220124000518.319850-63-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series remove unnecessary null checks | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Jan. 24, 2022, 12:04 a.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/qede/qede_main.c | 3 +--
 drivers/net/qede/qede_rxtx.c | 6 ++----
 2 files changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index 2d1f70693a3d..ad101194d613 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -335,8 +335,7 @@  static int qed_slowpath_start(struct ecore_dev *edev,
 err:
 #ifdef CONFIG_ECORE_BINARY_FW
 	if (IS_PF(edev)) {
-		if (edev->firmware)
-			rte_free(edev->firmware);
+		rte_free(edev->firmware);
 		edev->firmware = NULL;
 	}
 #endif
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 7088c57b501d..1c0a6ba5f1bf 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -706,12 +706,10 @@  void qede_dealloc_fp_resc(struct rte_eth_dev *eth_dev)
 		}
 	}
 
-	if (qdev->fp_array)
-		rte_free(qdev->fp_array);
+	rte_free(qdev->fp_array);
 	qdev->fp_array = NULL;
 
-	if (qdev->fp_array_cmt)
-		rte_free(qdev->fp_array_cmt);
+	rte_free(qdev->fp_array_cmt);
 	qdev->fp_array_cmt = NULL;
 }