diff mbox series

[v3] net/virtio: fix repeated memory free of vq

Message ID 20210829085047.95-1-gaoxiangliu0@163.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers show
Series [v3] net/virtio: fix repeated memory free of vq | expand


Context Check Description
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance fail Performance Testing issues
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/checkpatch success coding style OK

Commit Message

Gaoxiang Liu Aug. 29, 2021, 8:50 a.m. UTC
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>

* Fix spelling warning

* Add detailed log
 drivers/net/virtio/virtio_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series


diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 056830566..fc72d71cb 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -631,6 +631,7 @@  virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)
+	hw->vqs[queue_idx] = NULL;
 	return ret;