DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/af_xdp: fix memzone leak in error path
@ 2023-12-01  8:03 Yunjian Wang
  2023-12-04 14:09 ` Ferruh Yigit
  2023-12-05 12:23 ` [PATCH v2] " Yunjian Wang
  0 siblings, 2 replies; 8+ messages in thread
From: Yunjian Wang @ 2023-12-01  8:03 UTC (permalink / raw)
  To: dev
  Cc: ciara.loftus, qi.z.zhang, xudingke, jerry.lilijun, Yunjian Wang, stable

In xdp_umem_configure() allocated memzone for the 'umem', we should
free it when xsk_umem__create() call fails, otherwise it will lead
to memory zone leak.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 2a20a6960c..2a1fdafb3c 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -1229,6 +1229,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
 
 	if (ret) {
 		AF_XDP_LOG(ERR, "Failed to create umem\n");
+		rte_memzone_free(mz);
 		goto err;
 	}
 	umem->mz = mz;
-- 
2.33.0


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

end of thread, other threads:[~2023-12-06 12:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-01  8:03 [dpdk-dev] [PATCH] net/af_xdp: fix memzone leak in error path Yunjian Wang
2023-12-04 14:09 ` Ferruh Yigit
2023-12-05  1:23   ` wangyunjian
2023-12-05  9:41     ` Ferruh Yigit
2023-12-05 12:31       ` wangyunjian
2023-12-05 12:23 ` [PATCH v2] " Yunjian Wang
2023-12-05 13:16   ` Loftus, Ciara
2023-12-06 12:29     ` Ferruh Yigit

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).