提交 8343ef24 编写于 作者: D Dmitry Adamushko 提交者: Ingo Molnar

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: NDmitry Adamushko <dmitry.adamushko@gmail.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 636a3178
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册