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

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

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;
 }
-- 
2.30.2

Reply via email to