From 5d903aee8ad0243320a23d0e1e7b34b96024e007 Mon Sep 17 00:00:00 2001 From: Gaoxiang Liu Date: Tue, 31 Aug 2021 22:39:51 +0800 Subject: [PATCH] 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 Reviewed-by: Chenbo Xia --- drivers/net/virtio/virtio_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 061d02f666..51fa85b078 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -632,6 +632,7 @@ free_mz: rte_memzone_free(mz); free_vq: rte_free(vq); + hw->vqs[queue_idx] = NULL; return ret; } -- 2.20.1