summaryrefslogtreecommitdiffstats
path: root/hw/s390x/s390-virtio.c
diff options
context:
space:
mode:
authorCornelia Huck2016-03-10 10:19:46 +0100
committerCornelia Huck2016-03-10 12:02:02 +0100
commit75cfb3bb41005b1cbba4954057ad5426df83f6d7 (patch)
treeaead1869d772fca4f8180cc0675eee8de67293d4 /hw/s390x/s390-virtio.c
parents390x: Introduce S390MachineClass (diff)
downloadqemu-75cfb3bb41005b1cbba4954057ad5426df83f6d7.tar.gz
qemu-75cfb3bb41005b1cbba4954057ad5426df83f6d7.tar.xz
qemu-75cfb3bb41005b1cbba4954057ad5426df83f6d7.zip
s390x/cpu: use g_new0
Let's use g_new0 to allocate cpu_states. Suggested-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw/s390x/s390-virtio.c')
-rw-r--r--hw/s390x/s390-virtio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
index 4ea9040f3a..7c6e281af1 100644
--- a/hw/s390x/s390-virtio.c
+++ b/hw/s390x/s390-virtio.c
@@ -103,7 +103,7 @@ void s390_init_cpus(MachineState *machine)
machine->cpu_model = "host";
}
- cpu_states = g_malloc0(sizeof(S390CPU *) * max_cpus);
+ cpu_states = g_new0(S390CPU *, max_cpus);
for (i = 0; i < max_cpus; i++) {
name = g_strdup_printf("cpu[%i]", i);