[PATCH] net/mlx5: fix leak in HWS flow counter action
David Marchand
david.marchand at redhat.com
Mon Jan 27 11:53:47 CET 2025
This was caught by our internal covscan.
mp_name can be leaked in case of errors.
Fixes: 4d368e1da3a4 ("net/mlx5: support flow counter action for HWS")
Cc: stable at dpdk.org
Signed-off-by: David Marchand <david.marchand at redhat.com>
---
drivers/net/mlx5/mlx5_hws_cnt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_hws_cnt.c b/drivers/net/mlx5/mlx5_hws_cnt.c
index 0197c098f6..eaceedd5ba 100644
--- a/drivers/net/mlx5/mlx5_hws_cnt.c
+++ b/drivers/net/mlx5/mlx5_hws_cnt.c
@@ -723,7 +723,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
if (priv->sh->cnt_svc == NULL) {
ret = mlx5_hws_cnt_svc_init(priv->sh, error);
if (ret)
- return ret;
+ goto error;
}
cparam.fetch_sz = HWS_CNT_CACHE_FETCH_DEFAULT;
cparam.preload_sz = HWS_CNT_CACHE_PRELOAD_DEFAULT;
@@ -767,6 +767,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
MLX5_ASSERT(ret);
mlx5_hws_cnt_pool_destroy(priv->sh, cpool);
priv->hws_cpool = NULL;
+ mlx5_free(mp_name);
return ret;
}
--
2.47.1
More information about the dev
mailing list