diff options
author | Borislav Petkov <bp@suse.de> | 2015-02-05 19:35:19 +0100 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2015-03-02 20:31:03 +0100 |
commit | 776d3cdc93d83808bf5929d716a56c69bbe01d2f (patch) | |
tree | 31b5970f3935fbb194df4afef15c7d0451a87396 /arch/x86/kernel/cpu/microcode | |
parent | d496a002ae1f02425168e5211c237abee588651a (diff) | |
download | linux-776d3cdc93d83808bf5929d716a56c69bbe01d2f.tar.bz2 |
x86/microcode/intel: Check if microcode was found before applying
We should check the return value of the routines fishing out the proper
microcode and not try to apply if we haven't found a suitable blob.
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'arch/x86/kernel/cpu/microcode')
-rw-r--r-- | arch/x86/kernel/cpu/microcode/intel_early.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/microcode/intel_early.c b/arch/x86/kernel/cpu/microcode/intel_early.c index 3a6c6136c9da..d515ff3feb8b 100644 --- a/arch/x86/kernel/cpu/microcode/intel_early.c +++ b/arch/x86/kernel/cpu/microcode/intel_early.c @@ -727,9 +727,10 @@ _load_ucode_intel_bsp(struct mc_saved_data *mc_saved_data, ret = load_microcode(mc_saved_data, mc_saved_in_initrd, initrd_start_early, uci); + if (ret != UCODE_OK) + return; - if (ret == UCODE_OK) - apply_microcode_early(uci, true); + apply_microcode_early(uci, true); } void __init @@ -769,6 +770,7 @@ void load_ucode_intel_ap(void) struct ucode_cpu_info uci; unsigned long *mc_saved_in_initrd_p; unsigned long initrd_start_addr; + enum ucode_state ret; #ifdef CONFIG_X86_32 unsigned long *initrd_start_p; @@ -791,8 +793,12 @@ void load_ucode_intel_ap(void) return; collect_cpu_info_early(&uci); - load_microcode(mc_saved_data_p, mc_saved_in_initrd_p, - initrd_start_addr, &uci); + ret = load_microcode(mc_saved_data_p, mc_saved_in_initrd_p, + initrd_start_addr, &uci); + + if (ret != UCODE_OK) + return; + apply_microcode_early(&uci, true); } |