[PATCH] regex/mlx5: fix improper memory object check
Weiguo Li
liwg06 at foxmail.com
Tue Jan 25 12:51:41 CET 2022
Fixes: e3dbbf718ebc ("regex/mlx5: support configuration")
Signed-off-by: Weiguo Li <liwg06 at foxmail.com>
---
drivers/regex/mlx5/mlx5_rxp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regex/mlx5/mlx5_rxp.c b/drivers/regex/mlx5/mlx5_rxp.c
index 5ead3ca341..51b6e71376 100644
--- a/drivers/regex/mlx5/mlx5_rxp.c
+++ b/drivers/regex/mlx5/mlx5_rxp.c
@@ -148,7 +148,7 @@ mlx5_regex_configure(struct rte_regexdev *dev,
dev->data->dev_conf.nb_queue_pairs = priv->nb_queues;
priv->qps = rte_zmalloc(NULL, sizeof(struct mlx5_regex_qp) *
priv->nb_queues, 0);
- if (!priv->nb_queues) {
+ if (!priv->qps) {
DRV_LOG(ERR, "can't allocate qps memory");
rte_errno = ENOMEM;
return -rte_errno;
--
2.25.1
More information about the dev
mailing list