[PATCH 23.11] app/testpmd: fix flow job list double-free on reattach
Maayan Kashani
mkashani at nvidia.com
Tue Nov 3 15:01:40 CET 2026
[ upstream commit a3fe115b2b971d77c65799eee9c90526dfc8129d ]
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: fb6891a7b5a5 ("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>
Signed-off-by: Maayan Kashani <mkashani 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 98cc12a2ad3..06c2ec5e96a 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3462,6 +3462,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.25.1
More information about the stable
mailing list