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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 20 15:56:30 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/22/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/752630dd09ab2a517c3c84af888484c463665605

Thanks.

Luca Boccassi

---
>From 752630dd09ab2a517c3c84af888484c463665605 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 5e07db199e..173b2d64f6 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1832,6 +1832,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.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-02-20 14:55:46.603336472 +0000
+++ 0088-net-mlx5-fix-memory-leak-after-device-spawn-failure.patch	2026-02-20 14:55:43.328193177 +0000
@@ -1 +1 @@
-From 093b145b3af3eb3f2b7a8392b7d720b24e119dd3 Mon Sep 17 00:00:00 2001
+From 752630dd09ab2a517c3c84af888484c463665605 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 5e07db199e..173b2d64f6 100644
@@ -23 +24 @@
-@@ -1831,6 +1831,11 @@ error:
+@@ -1832,6 +1832,11 @@ error:


More information about the stable mailing list