* [PATCH] net/mlx5: fix segfault in counter pool destroy
@ 2025-06-25 9:32 Maayan Kashani
0 siblings, 0 replies; only message in thread
From: Maayan Kashani @ 2025-06-25 9:32 UTC (permalink / raw)
To: dev
Cc: mkashani, rasland, stable, Bing Zhao, Dariusz Sosnowski,
Viacheslav Ovsiienko, Ori Kam, Suanming Mou, Matan Azrad
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>
---
drivers/net/mlx5/mlx5_hws_cnt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_hws_cnt.c b/drivers/net/mlx5/mlx5_hws_cnt.c
index 83db242bf90..fce7a7e815f 100644
--- 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);
}
mlx5_hws_cnt_pool_action_destroy(cpool);
--
2.21.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-25 9:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-25 9:32 [PATCH] net/mlx5: fix segfault in counter pool destroy Maayan Kashani
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).