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: [email protected]
Signed-off-by: Yunjian Wang <[email protected]>
---
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