diff mbox series

[45/82] net/dpaa: remove unnecessary NULL checks

Message ID 20220124000518.319850-46-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/dpaa/dpaa_ethdev.c  | 3 +--
 drivers/net/dpaa/fmlib/fm_lib.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

Comments

Hemant Agrawal Jan. 24, 2022, 5:01 a.m. UTC | #1
Acked-by:  Hemant Agrawal <hemant.agrawal@nxp.com>
diff mbox series

Patch

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 2c2c4e4ebb5d..90208a31de26 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -463,8 +463,7 @@  static int dpaa_eth_dev_close(struct rte_eth_dev *dev)
 	}
 
 	/* release configuration memory */
-	if (dpaa_intf->fc_conf)
-		rte_free(dpaa_intf->fc_conf);
+	rte_free(dpaa_intf->fc_conf);
 
 	/* Release RX congestion Groups */
 	if (dpaa_intf->cgr_rx) {
diff --git a/drivers/net/dpaa/fmlib/fm_lib.c b/drivers/net/dpaa/fmlib/fm_lib.c
index 0d1ca12378d8..1d6816050c2f 100644
--- a/drivers/net/dpaa/fmlib/fm_lib.c
+++ b/drivers/net/dpaa/fmlib/fm_lib.c
@@ -408,8 +408,7 @@  fm_port_close(t_handle h_fm_port)
 	_fml_dbg("Calling...\n");
 
 	close(p_dev->fd);
-	if (p_dev->h_user_priv)
-		free(p_dev->h_user_priv);
+	free(p_dev->h_user_priv);
 	free(p_dev);
 
 	_fml_dbg("Finishing.\n");