net/mlx5: fix leak in HWS flow counter action
PATCH 1/1 net/mlx5: fix leak in HWS flow counter action
This was caught by our internal covscan.mp_name can be leaked in case of errors.
--- drivers/net/mlx5/mlx5_hws_cnt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_hws_cnt.c +2 -1
@@ -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; }
Signature · 1 line
2.47.1
Quoted 13 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Monday, January 27, 2025 11:54
To: [email protected]
Cc: [email protected]; Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Matan Azrad <[email protected]>; Jack Min <[email protected]>
Subject: [PATCH] net/mlx5: fix leak in HWS flow counter actionExternal email: Use caution opening links or attachments
Quoted 7 lines
This was caught by our internal covscan.
mp_namecan be leaked in case of errors.Fixes 4d368e1da3a4 ("net/mlx5: support flow counter action for HWS")Signed-off-by David Marchand <[email protected]>
Best regards,
Dariusz Sosnowski
Hi,
From: David Marchand <[email protected]>
Sent: Monday, January 27, 2025 12:53 PM
To: [email protected]
Cc: [email protected]; Dariusz Sosnowski; Slava Ovsiienko; Bing Zhao; Ori Kam; Suanming Mou; Matan Azrad; Jack Min
Subject: [PATCH] net/mlx5: fix leak in HWS flow counter action
This was caught by our internal covscan.mp_name can be leaked in case of errors.
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh