diff options
author | Ming Lei <ming.lei@canonical.com> | 2014-11-11 09:17:09 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-11-11 12:03:47 +0100 |
commit | ed4b43265d4d0c7ecfbbcb4001f61700756f22b9 (patch) | |
tree | f587ab9cc839b6cbd655631b9c1d86eaf4fe5841 /hw/scsi | |
parent | 25aaa2c568a11bd79b7b83c857278232f6fa7be6 (diff) |
virtio-scsi: dataplane: fix allocation for 'cmd_vrings'
The size of each element should be sizeof(VirtIOSCSIVring *).
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi')
-rw-r--r-- | hw/scsi/virtio-scsi-dataplane.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c index 9651e6f274..969b931557 100644 --- a/hw/scsi/virtio-scsi-dataplane.c +++ b/hw/scsi/virtio-scsi-dataplane.c @@ -230,7 +230,7 @@ void virtio_scsi_dataplane_start(VirtIOSCSI *s) if (!s->event_vring) { goto fail_vrings; } - s->cmd_vrings = g_malloc0(sizeof(VirtIOSCSIVring) * vs->conf.num_queues); + s->cmd_vrings = g_new(VirtIOSCSIVring *, vs->conf.num_queues); for (i = 0; i < vs->conf.num_queues; i++) { s->cmd_vrings[i] = virtio_scsi_vring_init(s, vs->cmd_vqs[i], |