regex/mlx5: fix memory allocation check

The wrong field was checked after allocation.

Fixes: e3dbbf718ebc ("regex/mlx5: support configuration")
Cc: stable@dpdk.org

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
This commit is contained in:
Weiguo Li 2022-01-25 19:51:41 +08:00 committed by Thomas Monjalon
parent 56b5bb509f
commit 60e9028a8e

View File

@ -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;