From 33d1405fc3264200d762c08728f4155335799456 Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Tue, 20 Oct 2020 23:02:37 +0800 Subject: [PATCH] net/thunderx: fix memory leak on rbdr desc ring failure In nicvf_qset_rbdr_alloc(), we allocate memory for the 'rbdr' structure but not released when allocate 'rbdr desc ring' fails. Fixes: 7413feee662d ("net/thunderx: add device start/stop and close") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang Acked-by: Jerin Jacob --- drivers/net/thunderx/nicvf_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index f0bd20a22b..b6bb05e500 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -638,6 +638,7 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic, NICVF_RBDR_BASE_ALIGN_BYTES, nic->node); if (rz == NULL) { PMD_INIT_LOG(ERR, "Failed to allocate mem for rbdr desc ring"); + rte_free(rbdr); return -ENOMEM; } -- 2.20.1