Skip to content

Commit

Permalink
x86, amd, microcode: Fix error path in apply_microcode_amd()
Browse files Browse the repository at this point in the history
Return -1 (like Intels apply_microcode) when the loading fails, also
do not set the active microcode level on failure.

Signed-off-by: Torsten Kaiser <just.for.lkml@googlemail.com>
Link: http://lkml.kernel.org/r/20130723225823.2e4e7588@googlemail.com
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
Torsten Kaiser authored and H. Peter Anvin committed Jul 31, 2013
1 parent f155b63 commit d982057
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arch/x86/kernel/microcode_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,13 @@ int apply_microcode_amd(int cpu)
return 0;
}

if (__apply_microcode_amd(mc_amd))
if (__apply_microcode_amd(mc_amd)) {
pr_err("CPU%d: update failed for patch_level=0x%08x\n",
cpu, mc_amd->hdr.patch_id);
else
pr_info("CPU%d: new patch_level=0x%08x\n", cpu,
mc_amd->hdr.patch_id);
return -1;
}
pr_info("CPU%d: new patch_level=0x%08x\n", cpu,
mc_amd->hdr.patch_id);

uci->cpu_sig.rev = mc_amd->hdr.patch_id;
c->microcode = mc_amd->hdr.patch_id;
Expand Down

0 comments on commit d982057

Please sign in to comment.