[PATCH v3 3/6] net/iavf: fix memory leak on error when adding flow parser

Bruce Richardson bruce.richardson at intel.com
Fri Jul 10 12:34:00 CEST 2026


In iavf_register_parser, the final "else" branch is an error leg which
returns immediately, without adding the newly allocated parser_node to a
TAILQ. Add a free call for that parser_node in the error case to avoid
leaking memory.

Fixes: ff2d0c345c3b ("net/iavf: support generic flow API")
Cc: stable at dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Ciara Loftus <ciara.loftus at intel.com>
---
 drivers/net/intel/iavf/iavf_generic_flow.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/intel/iavf/iavf_generic_flow.c b/drivers/net/intel/iavf/iavf_generic_flow.c
index 84bb161bd1..92ca20031c 100644
--- a/drivers/net/intel/iavf/iavf_generic_flow.c
+++ b/drivers/net/intel/iavf/iavf_generic_flow.c
@@ -1911,6 +1911,7 @@ iavf_register_parser(struct iavf_flow_parser *parser,
 		list = &vf->dist_parser_list;
 		TAILQ_INSERT_HEAD(list, parser_node, node);
 	} else {
+		rte_free(parser_node);
 		return -EINVAL;
 	}
 
-- 
2.53.0



More information about the dev mailing list