Skip to content

Commit

Permalink
regex/mlx5: fix memory allocation check
Browse files Browse the repository at this point in the history
[ upstream commit 60e9028 ]

The wrong field was checked after allocation.

Fixes: e3dbbf7 ("regex/mlx5: support configuration")

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
  • Loading branch information
liwg06 authored and kevintraynor committed Feb 21, 2022
1 parent 7248794 commit 6b06137
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regex/mlx5/mlx5_rxp.c
Expand Up @@ -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;
Expand Down

0 comments on commit 6b06137

Please sign in to comment.