DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] efd: fix tailq entry leak in error path
@ 2020-09-29  3:31 wangyunjian
  2020-10-20 14:10 ` Thomas Monjalon
  2020-10-22 20:06 ` David Marchand
  0 siblings, 2 replies; 4+ messages in thread
From: wangyunjian @ 2020-09-29  3:31 UTC (permalink / raw)
  To: dev
  Cc: byron.marohn, yipeng1.wang, jerry.lilijun, xudingke,
	Yunjian Wang, stable

From: Yunjian Wang <wangyunjian@huawei.com>

In rte_efd_create() allocated memory for tailq entry, we should
free it when error happens, otherwise it will lead to memory leak.

Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 lib/librte_efd/rte_efd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c
index 6a799556d..0aa120f48 100644
--- a/lib/librte_efd/rte_efd.c
+++ b/lib/librte_efd/rte_efd.c
@@ -707,6 +707,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,
 
 error_unlock_exit:
 	rte_mcfg_tailq_write_unlock();
+	rte_free(te);
 	rte_efd_free(table);
 
 	return NULL;
-- 
2.23.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-22 20:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29  3:31 [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path wangyunjian
2020-10-20 14:10 ` Thomas Monjalon
2020-10-20 20:24   ` Wang, Yipeng1
2020-10-22 20:06 ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).