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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git