From: Yunjian Wang Date: Tue, 7 Apr 2020 11:35:43 +0000 (+0800) Subject: net/octeontx: fix dangling pointer on init failure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5ed5df8073c80d1af9ec8c89a8b2a5299463058d;p=dpdk.git 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 --- 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);