[PATCH] app/testpmd: fix flow cfg double-free after reattach

Maayan Kashani mkashani at nvidia.com
Mon Jul 6 13:52:48 CEST 2026


From: Shani Peretz <shperetz at nvidia.com>

When a port is closed via close_port(), port_free_job_list() frees the
job_list but does not NULL the pointer or reset queue_nb. If the port
is later reattached and "flow configure" is issued, port_flow_configure()
frees the dangling job_list pointer, causing a double-free.

Fix this by setting job_list to NULL and resetting queue_nb to zero in
port_free_job_list() after freeing.

Fixes: 7fadc8039588 ("app/testpmd: fix memory leak in port flow configure")
Cc: stable at dpdk.org

Signed-off-by: Shani Peretz <shperetz at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 app/test-pmd/testpmd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 9a85657840a..ef337a4d144 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3358,6 +3358,8 @@ port_free_job_list(portid_t pi)
 {
 	struct rte_port *port = &ports[pi];
 	free(port->job_list);
+	port->job_list = NULL;
+	port->queue_nb = 0;
 }
 
 static void
-- 
2.21.0



More information about the stable mailing list