DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix leak in HWS flow counter action
@ 2025-01-27 10:53 David Marchand
  2025-02-18 15:42 ` Dariusz Sosnowski
  0 siblings, 1 reply; 2+ messages in thread
From: David Marchand @ 2025-01-27 10:53 UTC (permalink / raw)
  To: dev
  Cc: stable, Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao,
	Ori Kam, Suanming Mou, Matan Azrad, Xiaoyu Min

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@dpdk.org

Signed-off-by: David Marchand <david.marchand@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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] net/mlx5: fix leak in HWS flow counter action
  2025-01-27 10:53 [PATCH] net/mlx5: fix leak in HWS flow counter action David Marchand
@ 2025-02-18 15:42 ` Dariusz Sosnowski
  0 siblings, 0 replies; 2+ messages in thread
From: Dariusz Sosnowski @ 2025-02-18 15:42 UTC (permalink / raw)
  To: David Marchand, dev
  Cc: stable, Slava Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
	Matan Azrad, Jack Min

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Monday, January 27, 2025 11:54
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Dariusz Sosnowski <dsosnowski@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Bing Zhao <bingz@nvidia.com>; Ori Kam
> <orika@nvidia.com>; Suanming Mou <suanmingm@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Jack Min <jackmin@nvidia.com>
> Subject: [PATCH] net/mlx5: fix leak in HWS flow counter action
> 
> External email: Use caution opening links or attachments
> 
> 
> 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@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>

Best regards,
Dariusz Sosnowski

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-18 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-27 10:53 [PATCH] net/mlx5: fix leak in HWS flow counter action David Marchand
2025-02-18 15:42 ` Dariusz Sosnowski

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).