[v3] net/virtio: fix repeated memory free of vq
Checks
Commit Message
When virtio_init_queue returns error, the memory of vq is freed.
But the value of hw->vqs[queue_idx] does not restore.
If virtio_init_queue returns error, the memory of vq is freed again
in virtio_free_queues.
Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
Cc: stable@dpdk.org
Signed-off-by: Gaoxiang Liu <gaoxiangliu0@163.com>
---
v2:
* Fix spelling warning
v3:
* Add detailed log
---
drivers/net/virtio/virtio_ethdev.c | 1 +
1 file changed, 1 insertion(+)
@@ -631,6 +631,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)
rte_memzone_free(mz);
free_vq:
rte_free(vq);
+ hw->vqs[queue_idx] = NULL;
return ret;
}