[dpdk-stable] [dpdk-dev] [PATCH v1] net/octeontx: fix dangling pointer on failure

wangyunjian wangyunjian at huawei.com
Tue Apr 7 13:35:43 CEST 2020


From: Yunjian Wang <wangyunjian at huawei.com>

When octeontx_create() is cleaning up, it does not correctly set
the mac_addrs variable to NULL, which will lead to a double free.

Fixes: 9e399b88ce2f ("net/octeontx: fix memory leak of MAC address table")
CC: stable at dpdk.org

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

diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index e8aa4ec78..437abd7e5 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -1181,6 +1181,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
 
 free_mac_addrs:
 	rte_free(data->mac_addrs);
+	data->mac_addrs = NULL;
 err:
 	if (nic)
 		octeontx_port_close(nic);
-- 
2.19.1




More information about the stable mailing list