patch 'net/mlx5: fix leak in HWS flow counter action' has been queued to stable release 23.11.4

Xueming Li xuemingl at nvidia.com
Tue Apr 8 10:01:44 CEST 2025


Hi,

FYI, your patch has been queued to stable release 23.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/10/25. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c544957af5fc3e3a83342c8205af524bc711eff1

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From c544957af5fc3e3a83342c8205af524bc711eff1 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Mon, 27 Jan 2025 11:53:47 +0100
Subject: [PATCH] net/mlx5: fix leak in HWS flow counter action
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 9e34fcc81c005a60c919c572ef83c10ebb0201af ]

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

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.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 7a88a4001a..ca6fd51cc6 100644
--- a/drivers/net/mlx5/mlx5_hws_cnt.c
+++ b/drivers/net/mlx5/mlx5_hws_cnt.c
@@ -677,7 +677,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);
 		if (ret != 0)
-			return NULL;
+			goto error;
 	}
 	cparam.fetch_sz = HWS_CNT_CACHE_FETCH_DEFAULT;
 	cparam.preload_sz = HWS_CNT_CACHE_PRELOAD_DEFAULT;
@@ -713,6 +713,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
 	return cpool;
 error:
 	mlx5_hws_cnt_pool_destroy(priv->sh, cpool);
+	mlx5_free(mp_name);
 	return NULL;
 }
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-04-08 15:39:06.612768759 +0800
+++ 0020-net-mlx5-fix-leak-in-HWS-flow-counter-action.patch	2025-04-08 15:39:05.916436584 +0800
@@ -1 +1 @@
-From 9e34fcc81c005a60c919c572ef83c10ebb0201af Mon Sep 17 00:00:00 2001
+From c544957af5fc3e3a83342c8205af524bc711eff1 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 9e34fcc81c005a60c919c572ef83c10ebb0201af ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -19 +21 @@
-index 0197c098f6..eaceedd5ba 100644
+index 7a88a4001a..ca6fd51cc6 100644
@@ -22 +24 @@
-@@ -723,7 +723,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
+@@ -677,7 +677,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
@@ -24,3 +26,3 @@
- 		ret = mlx5_hws_cnt_svc_init(priv->sh, error);
- 		if (ret)
--			return ret;
+ 		ret = mlx5_hws_cnt_svc_init(priv->sh);
+ 		if (ret != 0)
+-			return NULL;
@@ -31,2 +33,3 @@
-@@ -767,6 +767,7 @@ error:
- 	MLX5_ASSERT(ret);
+@@ -713,6 +713,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
+ 	return cpool;
+ error:
@@ -34 +36,0 @@
- 	priv->hws_cpool = NULL;
@@ -36 +38 @@
- 	return ret;
+ 	return NULL;


More information about the stable mailing list