diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2010-09-27 15:16:16 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-10-20 16:15:04 -0500 |
commit | db0ad1ba047b59cb89865008dcd0edd301e84c37 (patch) | |
tree | 88d4ceb62a73de413d892ba7a4077077439074ef /target-i386 | |
parent | 1e027be7e91d854d7a0132e4a32bdf222c33dcfe (diff) |
Set cpuid definition to 0 before initializing it
This patch cleans the (stack-allocated) cpuid definition to
0 before actually initializing it.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'target-i386')
-rw-r--r-- | target-i386/cpuid.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 04ba8d5152..3fcf78f093 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -788,6 +788,8 @@ int cpu_x86_register (CPUX86State *env, const char *cpu_model) { x86_def_t def1, *def = &def1; + memset(def, 0, sizeof(*def)); + if (cpu_x86_find_by_name(def, cpu_model) < 0) return -1; if (def->vendor1) { |