aboutsummaryrefslogtreecommitdiff
path: root/hw/core/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/core/cpu.c')
-rw-r--r--hw/core/cpu.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/core/cpu.c b/hw/core/cpu.c
index 0f23409..594441a 100644
--- a/hw/core/cpu.c
+++ b/hw/core/cpu.c
@@ -59,8 +59,7 @@ CPUState *cpu_create(const char *typename)
{
Error *err = NULL;
CPUState *cpu = CPU(object_new(typename));
- qdev_realize(DEVICE(cpu), NULL, &err);
- if (err != NULL) {
+ if (!qdev_realize(DEVICE(cpu), NULL, &err)) {
error_report_err(err);
object_unref(OBJECT(cpu));
exit(EXIT_FAILURE);