From: Joerg Roedel Date: Mon, 27 Sep 2010 13:16:16 +0000 (+0200) Subject: Set cpuid definition to 0 before initializing it X-Git-Tag: v0.14.0-rc0~546 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db0ad1ba047b59cb89865008dcd0edd301e84c37;p=thirdparty%2Fqemu.git 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 Signed-off-by: Avi Kivity --- diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 04ba8d5152a..3fcf78f093a 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) {