diff mbox series

[73/82] regex/mlx5: remove unnecessary NULL checks

Message ID 20220124000518.319850-74-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:05 a.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/regex/mlx5/mlx5_regex.c | 3 +--
 drivers/regex/mlx5/mlx5_rxp.c   | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c
index e5a12fb3cc4d..48e39f6b8844 100644
--- a/drivers/regex/mlx5/mlx5_regex.c
+++ b/drivers/regex/mlx5/mlx5_regex.c
@@ -127,8 +127,7 @@  mlx5_regex_dev_probe(struct mlx5_common_device *cdev)
 	if (priv->regexdev)
 		rte_regexdev_unregister(priv->regexdev);
 dev_error:
-	if (priv)
-		rte_free(priv);
+	rte_free(priv);
 	return -rte_errno;
 }
 
diff --git a/drivers/regex/mlx5/mlx5_rxp.c b/drivers/regex/mlx5/mlx5_rxp.c
index 5ead3ca341ad..99db1e4a865c 100644
--- a/drivers/regex/mlx5/mlx5_rxp.c
+++ b/drivers/regex/mlx5/mlx5_rxp.c
@@ -166,7 +166,6 @@  mlx5_regex_configure(struct rte_regexdev *dev,
 		DRV_LOG(DEBUG, "Regex config without rules programming!");
 	return 0;
 configure_error:
-	if (priv->qps)
-		rte_free(priv->qps);
+	rte_free(priv->qps);
 	return -rte_errno;
 }