patch 'net/mlx5: fix leak in HWS flow counter action' has been queued to stable release 22.11.8
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Fri Mar 7 13:24:15 CET 2025
Hi,
FYI, your patch has been queued to stable release 22.11.8
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/09/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://github.com/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/d653878d18bd406c2b7b983cb09121e68894b645
Thanks.
Luca Boccassi
---
>From d653878d18bd406c2b7b983cb09121e68894b645 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
[ 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 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_hws_cnt.c b/drivers/net/mlx5/mlx5_hws_cnt.c
index 3250255727..cec0710efe 100644
--- a/drivers/net/mlx5/mlx5_hws_cnt.c
+++ b/drivers/net/mlx5/mlx5_hws_cnt.c
@@ -658,7 +658,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
struct mlx5_priv *priv = dev->data->dev_private;
struct mlx5_hws_cache_param cparam = {0};
struct mlx5_hws_cnt_pool_cfg pcfg = {0};
- char *mp_name;
+ char *mp_name = NULL;
int ret = 0;
size_t sz;
@@ -666,7 +666,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;
@@ -711,6 +711,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.47.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-03-07 12:23:38.613481872 +0000
+++ 0016-net-mlx5-fix-leak-in-HWS-flow-counter-action.patch 2025-03-07 12:23:38.014838527 +0000
@@ -1 +1 @@
-From 9e34fcc81c005a60c919c572ef83c10ebb0201af Mon Sep 17 00:00:00 2001
+From d653878d18bd406c2b7b983cb09121e68894b645 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9e34fcc81c005a60c919c572ef83c10ebb0201af ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -15,2 +16,2 @@
- drivers/net/mlx5/mlx5_hws_cnt.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ drivers/net/mlx5/mlx5_hws_cnt.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
@@ -19 +20 @@
-index 0197c098f6..eaceedd5ba 100644
+index 3250255727..cec0710efe 100644
@@ -22 +23,10 @@
-@@ -723,7 +723,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
+@@ -658,7 +658,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
+ struct mlx5_priv *priv = dev->data->dev_private;
+ struct mlx5_hws_cache_param cparam = {0};
+ struct mlx5_hws_cnt_pool_cfg pcfg = {0};
+- char *mp_name;
++ char *mp_name = NULL;
+ int ret = 0;
+ size_t sz;
+
+@@ -666,7 +666,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
@@ -24,3 +34,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 +41,3 @@
-@@ -767,6 +767,7 @@ error:
- MLX5_ASSERT(ret);
+@@ -711,6 +711,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
+ return cpool;
+ error:
@@ -34 +44,0 @@
- priv->hws_cpool = NULL;
@@ -36 +46 @@
- return ret;
+ return NULL;
More information about the stable
mailing list