[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/24] virtio: make virtio_delete_queue idempotent
From: |
Michael S. Tsirkin |
Subject: |
[PULL 02/24] virtio: make virtio_delete_queue idempotent |
Date: |
Thu, 19 Dec 2019 08:27:02 -0500 |
Let's make sure calling this twice is harmless -
no known instances, but seems safer.
Suggested-by: Pan Nengyuan <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/virtio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 31dd140990..6de3cfdc2c 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2337,6 +2337,7 @@ void virtio_delete_queue(VirtQueue *vq)
vq->handle_output = NULL;
vq->handle_aio_output = NULL;
g_free(vq->used_elems);
+ vq->used_elems = NULL;
}
void virtio_del_queue(VirtIODevice *vdev, int n)
--
MST
- [PULL 00/24] virtio, pci, pc: fixes, features, Michael S. Tsirkin, 2019/12/19
- [PULL 01/24] virtio: add ability to delete vq through a pointer, Michael S. Tsirkin, 2019/12/19
- [PULL 02/24] virtio: make virtio_delete_queue idempotent,
Michael S. Tsirkin <=
- [PULL 03/24] virtio-balloon: fix memory leak while attach virtio-balloon device, Michael S. Tsirkin, 2019/12/19
- [PULL 04/24] virtio-serial-bus: fix memory leak while attach virtio-serial-bus, Michael S. Tsirkin, 2019/12/19
- [PULL 05/24] virtio-input: convert to new virtio_delete_queue, Michael S. Tsirkin, 2019/12/19
- [PULL 06/24] intel_iommu: fix bug to read DMAR_RTADDR_REG, Michael S. Tsirkin, 2019/12/19
- [PULL 07/24] virtio: update queue size on guest write, Michael S. Tsirkin, 2019/12/19
- [PULL 09/24] Implement backend program convention command for vhost-user-blk, Michael S. Tsirkin, 2019/12/19
- [PULL 10/24] virtio: don't enable notifications during polling, Michael S. Tsirkin, 2019/12/19
- [PULL 12/24] numa: Extend CLI to provide memory latency and bandwidth information, Michael S. Tsirkin, 2019/12/19
- [PULL 13/24] numa: Extend CLI to provide memory side cache information, Michael S. Tsirkin, 2019/12/19
- [PULL 14/24] hmat acpi: Build Memory Proximity Domain Attributes Structure(s), Michael S. Tsirkin, 2019/12/19