]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
x86-microcode: fix unbalanced use of get_cpu()
authorDmitry Adamushko <dmitry.adamushko@gmail.com>
Tue, 19 Aug 2008 22:16:13 +0000 (00:16 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 20 Aug 2008 10:18:55 +0000 (12:18 +0200)
Don't use get_cpu() at all. Resort to checking a boot-up CPU (#0) in
microcode_{intel,amd}_module_init().

Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/microcode_amd.c
arch/x86/kernel/microcode_intel.c

index 33b2a217a8c552cc7ce616f9a1f74487c498051f..a6e76ccf815871295904cbbffa5bfe3db17828b3 100644 (file)
@@ -500,13 +500,15 @@ static struct microcode_ops microcode_amd_ops = {
 
 static int __init microcode_amd_module_init(void)
 {
-       struct cpuinfo_x86 *c = &cpu_data(get_cpu());
+       struct cpuinfo_x86 *c = &cpu_data(0);
 
        equiv_cpu_table = NULL;
-       if (c->x86_vendor == X86_VENDOR_AMD)
-               return microcode_init(&microcode_amd_ops, THIS_MODULE);
-       else
+       if (c->x86_vendor != X86_VENDOR_AMD) {
+               printk(KERN_ERR "microcode: CPU platform is not AMD-capable\n");
                return -ENODEV;
+       }
+
+       return microcode_init(&microcode_amd_ops, THIS_MODULE);
 }
 
 static void __exit microcode_amd_module_exit(void)
index d2d9d74f4cbb465d2ecacf51ed641f1755e982bc..6dd8907ff22ef4692c93997725a15ac10304721d 100644 (file)
@@ -531,12 +531,14 @@ static struct microcode_ops microcode_intel_ops = {
 
 static int __init microcode_intel_module_init(void)
 {
-       struct cpuinfo_x86 *c = &cpu_data(get_cpu());
+       struct cpuinfo_x86 *c = &cpu_data(0);
 
-       if (c->x86_vendor == X86_VENDOR_INTEL)
-               return microcode_init(&microcode_intel_ops, THIS_MODULE);
-       else
+       if (c->x86_vendor != X86_VENDOR_INTEL) {
+                printk(KERN_ERR "microcode: CPU platform is not Intel-capable\n");
                return -ENODEV;
+       }
+
+       return microcode_init(&microcode_intel_ops, THIS_MODULE);
 }
 
 static void __exit microcode_intel_module_exit(void)