patches for DPDK stable branches
 help / color / mirror / Atom feed
* Re: [PATCH] regex/mlx5: fix improper memory object check
       [not found] <tencent_4CA38D308974C5CCF2789C12444CEBDC7F0A@qq.com>
@ 2022-02-10 15:35 ` Thomas Monjalon
  0 siblings, 0 replies; only message in thread
From: Thomas Monjalon @ 2022-02-10 15:35 UTC (permalink / raw)
  To: Weiguo Li; +Cc: orika, dev, stable

25/01/2022 12:51, Weiguo Li:
> Fixes: e3dbbf718ebc ("regex/mlx5: support configuration")

Adding Cc stable@dpdk.org for backport.

> Signed-off-by: Weiguo Li <liwg06@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");

This mistake would have been caught earlier if the coding style was respected:
a pointer should be explictly compared with NULL.

Applied, thanks.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-10 15:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <tencent_4CA38D308974C5CCF2789C12444CEBDC7F0A@qq.com>
2022-02-10 15:35 ` [PATCH] regex/mlx5: fix improper memory object check Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).