From: Maayan Kashani <mkashani@nvidia.com>
To: <dev@dpdk.org>
Cc: <mkashani@nvidia.com>, <rasland@nvidia.com>,
Shani Peretz <shperetz@nvidia.com>, <stable@dpdk.org>,
Dariusz Sosnowski <dsosnowski@nvidia.com>,
Aman Singh <aman.deep.singh@intel.com>
Subject: [PATCH] app/testpmd: fix flow cfg double-free after reattach
Date: Mon, 6 Jul 2026 14:52:48 +0300 [thread overview]
Message-ID: <20260706115248.188551-1-mkashani@nvidia.com> (raw)
From: Shani Peretz <shperetz@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@dpdk.org
Signed-off-by: Shani Peretz <shperetz@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@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
next reply other threads:[~2026-07-06 11:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 11:52 Maayan Kashani [this message]
2026-07-10 21:45 ` [PATCH] app/testpmd: fix flow cfg double-free after reattach Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260706115248.188551-1-mkashani@nvidia.com \
--to=mkashani@nvidia.com \
--cc=aman.deep.singh@intel.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=rasland@nvidia.com \
--cc=shperetz@nvidia.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox