[PATCH v3 10/10] net/tap: free remote flow when implicit rule already exists

Stephen Hemminger
2026-02-20T05:05:26Z

When tap_flow_implicit_create() gets EEXIST from the kernel, the
allocated remote_flow is never freed. Add rte_free() on that path.

Bugzilla ID: 1880
Fixes: 2ef1c0da894a ("net/tap: fix isolation mode toggling")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/tap/tap_flow.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
index 427faf75d5..da1e70019a 100644
--- a/drivers/net/tap/tap_flow.c
+++ b/drivers/net/tap/tap_flow.c
@@ -1625,8 +1625,10 @@ int tap_flow_implicit_create(struct pmd_internals *pmd,
err = tap_nl_recv_ack(pmd->nlsk_fd);
if (err < 0) {
/* Silently ignore re-entering existing rule */
- if (errno == EEXIST)
+ if (errno == EEXIST) {
+ rte_free(remote_flow);
goto success;
+ }
TAP_LOG(ERR,
"Kernel refused TC filter rule creation (%d): %s",
errno, strerror(errno));
--
2.51.0