From 5ed5df8073c80d1af9ec8c89a8b2a5299463058d Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Tue, 7 Apr 2020 19:35:43 +0800 Subject: [PATCH] net/octeontx: fix dangling pointer on init failure 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@dpdk.org Signed-off-by: Yunjian Wang Acked-by: Harman Kalra --- 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 ea3b278a15..d5371ae07d 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -1454,6 +1454,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.20.1