qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC 08/13] cpu_x86_register: always initialize 'name' and


From: Eduardo Habkost
Subject: [Qemu-devel] [RFC 08/13] cpu_x86_register: always initialize 'name' and 'features'
Date: Thu, 16 Aug 2012 13:59:07 -0300

It's safer to initialize them than require that
compat_normalize_cpu_model() always initialize them, even on errors.

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

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 0bf62da..c48de43 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1503,8 +1503,8 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
 {
     X86CPUDefinition def1, *def = &def1;
     Error *error = NULL;
-    QDict *features;
-    char *name;
+    QDict *features = NULL;
+    char *name = NULL;
 
     /* for CPU subclasses should go into cpu_x86_init() before object_new() */
     compat_normalize_cpu_model(cpu_model, &name, &features, &error);
-- 
1.7.11.2




reply via email to

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