提交 93bd49af 编写于 作者: F Fam Zheng 提交者: Paolo Bonzini

virtio-scsi: Fix memory leak when realize failed

Signed-off-by: NFam Zheng <famz@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 c1d4096b
...@@ -808,6 +808,7 @@ void virtio_scsi_common_realize(DeviceState *dev, Error **errp, ...@@ -808,6 +808,7 @@ void virtio_scsi_common_realize(DeviceState *dev, Error **errp,
error_setg(errp, "Invalid number of queues (= %" PRId32 "), " error_setg(errp, "Invalid number of queues (= %" PRId32 "), "
"must be a positive integer less than %d.", "must be a positive integer less than %d.",
s->conf.num_queues, VIRTIO_PCI_QUEUE_MAX); s->conf.num_queues, VIRTIO_PCI_QUEUE_MAX);
virtio_cleanup(vdev);
return; return;
} }
s->cmd_vqs = g_malloc0(s->conf.num_queues * sizeof(VirtQueue *)); s->cmd_vqs = g_malloc0(s->conf.num_queues * sizeof(VirtQueue *));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册