aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2016-03-10 10:19:46 +0100
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-03-10 12:02:02 +0100
commit75cfb3bb41005b1cbba4954057ad5426df83f6d7 (patch)
treeaead1869d772fca4f8180cc0675eee8de67293d4 /hw
parent8b8a61ad8cc054e52b5d17c8ba45691d2dc0acbd (diff)
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')
-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);