DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Maayan Kashani <mkashani@nvidia.com>
Cc: dev@dpdk.org, rasland@nvidia.com, stable@dpdk.org,
	Bing Zhao <bingz@nvidia.com>,
	Dariusz Sosnowski <dsosnowski@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Ori Kam <orika@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>
Subject: Re: [PATCH] net/mlx5: fix segfault in counter pool destroy
Date: Thu, 26 Jun 2025 14:17:08 +0200	[thread overview]
Message-ID: <3811155.4herOUoSWf@thomas> (raw)
In-Reply-To: <20250625093248.167642-1-mkashani@nvidia.com>

25/06/2025 11:32, Maayan Kashani:
> When there is not enough memory, counter pool creation fails.
> As a result, the pool is being destroyed.
> Since not all pointers were initialized during creation,
> Need to check for null pointer in destruction.
> 
> Fixes: 13ea6bdcc7ee ("net/mlx5: support counters in cross port shared mode")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
> Acked-by: Bing Zhao <bingz@nvidia.com>
> ---
> --- a/drivers/net/mlx5/mlx5_hws_cnt.c
> +++ b/drivers/net/mlx5/mlx5_hws_cnt.c
> @@ -810,7 +810,7 @@ mlx5_hws_cnt_pool_destroy(struct mlx5_dev_ctx_shared *sh,
>  		LIST_REMOVE(cpool, next);
>  	rte_spinlock_unlock(&sh->cpool_lock);
>  	if (cpool->cfg.host_cpool == NULL) {
> -		if (--sh->cnt_svc->refcnt == 0)
> +		if (sh->cnt_svc && --sh->cnt_svc->refcnt == 0)
>  			mlx5_hws_cnt_svc_deinit(sh);

Applied, thanks.



      reply	other threads:[~2025-06-26 12:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25  9:32 Maayan Kashani
2025-06-26 12:17 ` Thomas Monjalon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3811155.4herOUoSWf@thomas \
    --to=thomas@monjalon.net \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=mkashani@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=suanmingm@nvidia.com \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).