[PATCH 45/82] net/dpaa: remove unnecessary NULL checks
Stephen Hemminger
stephen at networkplumber.org
Mon Jan 24 01:04:41 CET 2022
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/net/dpaa/dpaa_ethdev.c | 3 +--
drivers/net/dpaa/fmlib/fm_lib.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
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");
--
2.30.2
More information about the dev
mailing list