diff options
author | Dmitry Adamushko <dmitry.adamushko@gmail.com> | 2008-08-20 00:16:13 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-20 12:18:55 +0200 |
commit | 8343ef2437c599d30568e6b5a257a40bf2f4902b (patch) | |
tree | d7d2dc700536b628aea8e85aca113869263dde09 /arch/x86 | |
parent | 636a31781684d0f49208aa163f1a5a3a74210eb4 (diff) | |
download | blackbird-op-linux-8343ef2437c599d30568e6b5a257a40bf2f4902b.tar.gz blackbird-op-linux-8343ef2437c599d30568e6b5a257a40bf2f4902b.zip |
x86-microcode: fix unbalanced use of get_cpu()
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>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/microcode_amd.c | 10 | ||||
-rw-r--r-- | arch/x86/kernel/microcode_intel.c | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c index 33b2a217a8c5..a6e76ccf8158 100644 --- a/arch/x86/kernel/microcode_amd.c +++ b/arch/x86/kernel/microcode_amd.c @@ -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(µcode_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(µcode_amd_ops, THIS_MODULE); } static void __exit microcode_amd_module_exit(void) diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c index d2d9d74f4cbb..6dd8907ff22e 100644 --- a/arch/x86/kernel/microcode_intel.c +++ b/arch/x86/kernel/microcode_intel.c @@ -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(µcode_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(µcode_intel_ops, THIS_MODULE); } static void __exit microcode_intel_module_exit(void) |