]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
x86/cpuid: Fix build with CentOS 6 following c/s 7479151106
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 9 Sep 2019 15:53:28 +0000 (16:53 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 10 Sep 2019 12:34:29 +0000 (13:34 +0100)
GCC of a CentOS 6 vintage complains:

  cpuid.c: In function 'parse_xen_cpuid':
  cpuid.c:32: error: 'mid' may be used uninitialized in this function

This can't occur in practice because the while() loop is guarenteed to be
entered, but initialise mid to work around the issues.

Spotted by Gitlab CI.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpuid.c

index 36b1e2ce4c4ff3ee248091ffcf1832f5d177a52f..acba0f7583f9a2fb674c652949da3252ceaeb050 100644 (file)
@@ -29,7 +29,7 @@ static int __init parse_xen_cpuid(const char *s)
             const char *name;
             unsigned int bit;
         } features[] __initconstrel = INIT_FEATURE_NAMES;
-        const struct feature *lhs, *mid, *rhs;
+        const struct feature *lhs, *rhs, *mid = NULL /* GCC... */;
         const char *feat;
 
         ss = strchr(s, ',');