mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
libqos: add qvirtqueue_cleanup()
qvirtqueue_setup() allocates the vring and virtqueue state. So far there has been no function to free it. Callers have been using guest_free() for the vring but forgot to free the QVirtQueue state. This patch solves the memory leak by introducing qvirtqueue_cleanup(). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
c75f4c061b
commit
f1d3b99154
7 changed files with 36 additions and 7 deletions
|
@ -58,7 +58,7 @@ static void qvirtio_scsi_pci_free(QVirtIOSCSI *vs)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < vs->num_queues + 2; i++) {
|
||||
guest_free(vs->alloc, vs->vq[i]->desc);
|
||||
qvirtqueue_cleanup(&qvirtio_pci, vs->vq[i], vs->alloc);
|
||||
}
|
||||
pc_alloc_uninit(vs->alloc);
|
||||
qvirtio_pci_device_disable(container_of(vs->dev, QVirtioPCIDevice, vdev));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue