net/virtio: fix repeated freeing of virtqueue
authorGaoxiang Liu <liugaoxiang@huawei.com>
Tue, 31 Aug 2021 14:39:51 +0000 (22:39 +0800)
committerMaxime Coquelin <maxime.coquelin@redhat.com>
Tue, 14 Sep 2021 11:21:57 +0000 (13:21 +0200)
commit5d903aee8ad0243320a23d0e1e7b34b96024e007
treebbb92664191d728032b79253954edea44aa125e5
parent451dc0fad83d07d194e688f52093c7e888d2e317
net/virtio: fix repeated freeing of virtqueue

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 <liugaoxiang@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
drivers/net/virtio/virtio_ethdev.c