]> git.proxmox.com Git - mirror_qemu.git/commitdiff
virtio: Free rnd virqueue at unrealize()
authorEugenio Pérez <eperezma@redhat.com>
Fri, 25 Oct 2019 08:35:23 +0000 (10:35 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 25 Oct 2019 11:46:22 +0000 (07:46 -0400)
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>
hw/virtio/virtio-rng.c

index e93bed020f64297a75e061101864a7f74f5ea4b0..b498a20332636ed7e6a1d5054a15602170d341a8 100644 (file)
@@ -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);
 }