]> git.droids-corp.org - dpdk.git/commitdiff
regex/mlx5: fix memory allocation check
authorWeiguo Li <liwg06@foxmail.com>
Tue, 25 Jan 2022 11:51:41 +0000 (19:51 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 10 Feb 2022 15:32:19 +0000 (16:32 +0100)
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>
drivers/regex/mlx5/mlx5_rxp.c

index 5ead3ca341ad9eba1f3fbc1d137a91c4cdf272ad..51b6e71376af3987dfa19df83cf99b5ff5c916e8 100644 (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;