net/octeontx: fix dangling pointer on init failure
authorYunjian Wang <wangyunjian@huawei.com>
Tue, 7 Apr 2020 11:35:43 +0000 (19:35 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 5 May 2020 13:54:26 +0000 (15:54 +0200)
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 <wangyunjian@huawei.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
drivers/net/octeontx/octeontx_ethdev.c

index ea3b278..d5371ae 100644 (file)
@@ -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);