net/virtio: fix dangling pointer on failure
PATCH 1/1 net/virtio: fix dangling pointer on failure
When eth_virtio_dev_init() is cleaning up, it does not correctly set the mac_addrs variable to NULL, which will lead to a double free.
Found during unit-test fixes.
Fixes 43d18765c027 ("net/virtio: fix memory leak on failure")
Reported-by Michael Santana <[email protected]>
Signed-off-by Aaron Conole <[email protected]>
--- drivers/net/virtio/virtio_ethdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/virtio/virtio_ethdev.c +1 -0
@@ -1862,6 +1862,7 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) out:rte_free (eth_dev->data->mac_addrs); + eth_dev->data->mac_addrs =NULL ;return ret; }
Signature · 1 line
2.19.1
Quoted 5 lines · Aaron Conole
When
eth_virtio_dev_init()is cleaning up, it does not correctly set themac_addrsvariable to NULL, which will lead to a double free.Found during unit-test fixes.
Quoted 7 lines
Fixes 43d18765c027 ("net/virtio: fix memory leak on failure")Reported-by Michael Santana <[email protected]>Signed-off-by Aaron Conole <[email protected]>--- drivers/net/virtio/virtio_ethdev.c | 1 + 1 file changed, 1 insertion(+)
Reviewed-by Tiwei Bie <[email protected]>
Maxime Coquelin
AppliedQuoted 5 lines · Aaron Conole
When
eth_virtio_dev_init()is cleaning up, it does not correctly set themac_addrsvariable to NULL, which will lead to a double free.Found during unit-test fixes.
Quoted 7 lines
Fixes 43d18765c027 ("net/virtio: fix memory leak on failure")Reported-by Michael Santana <[email protected]>Signed-off-by Aaron Conole <[email protected]>--- drivers/net/virtio/virtio_ethdev.c | 1 + 1 file changed, 1 insertion(+)
Applied to dpdk-next-virtio/master.
Thanks,
Maxime