summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugenio Pérez <eperezma@redhat.com>2019-10-25 10:35:23 +0200
committerMichael S. Tsirkin <mst@redhat.com>2019-10-25 07:46:22 -0400
commit522bbb191cec2ac799f4bd662b0fcf6f00dfc2ea (patch)
tree902bf29ed2d6ca48e96007cbc46a62ed1df716ee
parent4a0117cf6e04d568a1963540bc0fa133b4d09b33 (diff)
downloadqemu-522bbb191cec2ac799f4bd662b0fcf6f00dfc2ea.zip
virtio: Free rnd virqueue at unrealize()
The function virtio_del_queue was not called at unrealize() callback. This was detected due to add an allocated element on the vq introduce in future commits (used_elems) and running address sanitizer memory leak detector. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Message-Id: <20191025083527.30803-5-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/virtio/virtio-rng.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index e93bed020f..b498a20332 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -238,6 +238,7 @@ static void virtio_rng_device_unrealize(DeviceState *dev, Error **errp)
qemu_del_vm_change_state_handler(vrng->vmstate);
timer_del(vrng->rate_limit_timer);
timer_free(vrng->rate_limit_timer);
+ virtio_del_queue(vdev, 0);
virtio_cleanup(vdev);
}