[Top][All Lists]
[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
- [Qemu-devel] [RFC 00/13] CPU init cleanup + CPU model classes (v2), Eduardo Habkost, 2012/08/16
- [Qemu-devel] [RFC 08/13] cpu_x86_register: always initialize 'name' and 'features',
Eduardo Habkost <=
- [Qemu-devel] [RFC 02/13] x86_cpudef_setup: coding style change, Eduardo Habkost, 2012/08/16
- [Qemu-devel] [RFC 04/13] move CPU x86 object creation to cpu.c, Eduardo Habkost, 2012/08/16
- [Qemu-devel] [RFC 13/13] HACK to initialize types later, Eduardo Habkost, 2012/08/16
- [Qemu-devel] [RFC 11/13] check for NULL cpu_model outside cpu_x86_find_by_name, Eduardo Habkost, 2012/08/16
- [Qemu-devel] [RFC 07/13] cpu_x86_create: move error handling to end of function, Eduardo Habkost, 2012/08/16
- [Qemu-devel] [RFC 03/13] i386: x86_def_t: rename 'flags' field, Eduardo Habkost, 2012/08/16
- [Qemu-devel] [RFC 01/13] target-i386/cpu.c: coding style fixes, Eduardo Habkost, 2012/08/16
- [Qemu-devel] [RFC 05/13] rename x86_def_t to X86CPUDefinition, Eduardo Habkost, 2012/08/16
- [Qemu-devel] [RFC 09/13] kill cpu_x86_register(), Eduardo Habkost, 2012/08/16
- [Qemu-devel] [RFC 06/13] move X86CPUDefinition to cpu-qom.h, Eduardo Habkost, 2012/08/16