patch 'net/mlx5: fix memory leak after device spawn failure' has been queued to stable release 23.11.7

Shani Peretz shperetz at nvidia.com
Tue Mar 31 08:24:41 CEST 2026


Hi,

FYI, your patch has been queued to stable release 23.11.7

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/05/26. 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/shanipr/dpdk-stable

This queued commit can be viewed at:
https://github.com/shanipr/dpdk-stable/commit/643710275c98b686032122937aa7b3b3ae11ad81

Thanks.

Shani

---
>From 643710275c98b686032122937aa7b3b3ae11ad81 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Thu, 18 Dec 2025 18:57:26 +0800
Subject: [PATCH] net/mlx5: fix memory leak after device spawn failure

[ upstream commit 093b145b3af3eb3f2b7a8392b7d720b24e119dd3 ]

In mlx5_dev_spawn() allocated memory for the 'priv->flows',
we should free it when errors occur, otherwise it will lead
to memory leak.

Fixes: b4edeaf3efd5 ("net/mlx5: replace flow list with indexed pool")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 99b5906c62..05ff22596c 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1775,6 +1775,11 @@ error:
 			close(priv->nl_socket_route);
 		if (priv->vmwa_context)
 			mlx5_vlan_vmwa_exit(priv->vmwa_context);
+		for (i = 0; i < MLX5_FLOW_TYPE_MAXI; i++) {
+			if (!priv->flows[i])
+				continue;
+			mlx5_ipool_destroy(priv->flows[i]);
+		}
 		if (eth_dev && priv->drop_queue.hrxq)
 			mlx5_drop_action_destroy(eth_dev);
 		if (priv->mtr_profile_tbl)
-- 
2.43.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-03-31 00:32:36.586012246 +0300
+++ 0082-net-mlx5-fix-memory-leak-after-device-spawn-failure.patch	2026-03-31 00:32:29.617369000 +0300
@@ -1 +1 @@
-From 093b145b3af3eb3f2b7a8392b7d720b24e119dd3 Mon Sep 17 00:00:00 2001
+From 643710275c98b686032122937aa7b3b3ae11ad81 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 093b145b3af3eb3f2b7a8392b7d720b24e119dd3 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 7f73183bb1..7624b2aba2 100644
+index 99b5906c62..05ff22596c 100644
@@ -23 +24 @@
-@@ -1831,6 +1831,11 @@ error:
+@@ -1775,6 +1775,11 @@ error:


More information about the stable mailing list