qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 15/19] cpu_x86_create: move error handling to end of f


From: Eduardo Habkost
Subject: [Qemu-devel] [RFC 15/19] cpu_x86_create: move error handling to end of function
Date: Thu, 2 Aug 2012 23:59:22 -0300

Signed-off-by: Eduardo Habkost <address@hidden>
---
 target-i386/cpu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index f30e621..7821331 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1489,12 +1489,15 @@ X86CPU *cpu_x86_create(const char *cpu_model)
     env = &cpu->env;
     env->cpu_model_str = cpu_model;
     if (cpu_x86_register(cpu, cpu_model) < 0) {
-        object_delete(OBJECT(cpu));
-        return NULL;
+        goto error;
     }
 
     x86_cpu_realize(OBJECT(cpu), NULL);
     return cpu;
+
+error:
+    object_delete(OBJECT(cpu));
+    return NULL;
 }
 
 #if !defined(CONFIG_USER_ONLY)
-- 
1.7.11.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]