patch 'app/testpmd: fix memory leak in port attach' has been queued to stable release 25.11.1

Kevin Traynor ktraynor at redhat.com
Thu Feb 26 14:08:33 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.1

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/02/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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/59bdea1f5622b9be47deb1d78edc2310e54c96a4

Thanks.

Kevin

---
>From 59bdea1f5622b9be47deb1d78edc2310e54c96a4 Mon Sep 17 00:00:00 2001
From: Shani Peretz <shperetz at nvidia.com>
Date: Tue, 2 Dec 2025 11:57:20 +0200
Subject: [PATCH] app/testpmd: fix memory leak in port attach

[ upstream commit d1b5082f134c50a07679f9068be472f62cf3b608 ]

The convert_pci_address_format() function was leaking memory because
rte_devargs_parse() allocates memory internally via strdup(), but the
function never called rte_devargs_reset() to free it.

Add a cleanup label to ensure rte_devargs_reset() is called on all
return paths.

Fixes: 12c2405989f6 ("app/testpmd: canonicalize short PCI name format")
Fixes: acbff64ea5b1 ("app/testpmd: fix devargs format in port attach")

Signed-off-by: Shani Peretz <shperetz at nvidia.com>
---
 app/test-pmd/testpmd.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 41695afd42..c91625eeac 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3434,4 +3434,5 @@ convert_pci_address_format(const char *identifier, char *pci_buffer, size_t buf_
 	struct rte_pci_addr pci_addr;
 	size_t pci_len;
+	char *result = NULL;
 
 	if (rte_devargs_parse(&da, identifier) != 0)
@@ -3439,16 +3440,20 @@ convert_pci_address_format(const char *identifier, char *pci_buffer, size_t buf_
 
 	if (da.bus == NULL)
-		return NULL;
+		goto cleanup;
 
 	if (strcmp(rte_bus_name(da.bus), "pci") != 0)
-		return NULL;
+		goto cleanup;
 
 	if (rte_pci_addr_parse(da.name, &pci_addr) != 0)
-		return NULL;
+		goto cleanup;
 
 	rte_pci_device_name(&pci_addr, pci_buffer, buf_size);
 	pci_len = strlen(pci_buffer);
 	snprintf(pci_buffer + pci_len, buf_size - pci_len, ",%s", da.args);
-	return pci_buffer;
+	result = pci_buffer;
+
+cleanup:
+	rte_devargs_reset(&da);
+	return result;
 }
 
-- 
2.53.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-02-26 10:16:48.327394744 +0000
+++ 0031-app-testpmd-fix-memory-leak-in-port-attach.patch	2026-02-26 10:16:46.934459163 +0000
@@ -1 +1 @@
-From d1b5082f134c50a07679f9068be472f62cf3b608 Mon Sep 17 00:00:00 2001
+From 59bdea1f5622b9be47deb1d78edc2310e54c96a4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d1b5082f134c50a07679f9068be472f62cf3b608 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 4f935738f6..3a080f9d8c 100644
+index 41695afd42..c91625eeac 100644
@@ -26 +27 @@
-@@ -3473,4 +3473,5 @@ convert_pci_address_format(const char *identifier, char *pci_buffer, size_t buf_
+@@ -3434,4 +3434,5 @@ convert_pci_address_format(const char *identifier, char *pci_buffer, size_t buf_
@@ -32 +33 @@
-@@ -3478,16 +3479,20 @@ convert_pci_address_format(const char *identifier, char *pci_buffer, size_t buf_
+@@ -3439,16 +3440,20 @@ convert_pci_address_format(const char *identifier, char *pci_buffer, size_t buf_



More information about the stable mailing list