app/testpmd: fix flow cfg double-free after reattach
PATCH 1/1 app/testpmd: fix flow cfg double-free after reattach
From: Shani Peretz <[email protected]>
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.
--- app/test-pmd/testpmd.c | 2 ++ 1 file changed, 2 insertions(+)
app/test-pmd/testpmd.c +2 -0
@@ -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
Signature · 1 line
2.21.0
Thomas Monjalon
Applied06/07/2026 13:52, Maayan Kashani:
Quoted 7 lines
From: Shani Peretz <[email protected]>
When a port is closed via
close_port(),port_free_job_list()frees thejob_listbut does not NULL the pointer or resetqueue_nb. If the port is later reattached and "flow configure" is issued,port_flow_configure()frees the danglingjob_listpointer, causing a double-free.
Quoted 8 lines
Fix this by setting
job_listto NULL and resettingqueue_nbto zero inport_free_job_list()after freeing.Fixes 7fadc8039588 ("app/testpmd: fix memory leak in port flow configure")Signed-off-by Shani Peretz <[email protected]>
Applied, thanks.