qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 21/35] virtio-scsi: Fix memory leak when realize fail


From: Paolo Bonzini
Subject: [Qemu-devel] [PULL 21/35] virtio-scsi: Fix memory leak when realize failed
Date: Fri, 31 Oct 2014 18:25:59 +0100

From: Fam Zheng <address@hidden>

Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 hw/scsi/virtio-scsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 7d40ecc..235c205 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -808,6 +808,7 @@ void virtio_scsi_common_realize(DeviceState *dev, Error 
**errp,
         error_setg(errp, "Invalid number of queues (= %" PRId32 "), "
                          "must be a positive integer less than %d.",
                    s->conf.num_queues, VIRTIO_PCI_QUEUE_MAX);
+        virtio_cleanup(vdev);
         return;
     }
     s->cmd_vqs = g_malloc0(s->conf.num_queues * sizeof(VirtQueue *));
-- 
1.8.3.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]