Commit 636a31781684d0f49208aa163f1a5a3a74210eb4

Authored by Peter Oruba
Committed by Ingo Molnar
1 parent d33dcb9e7d

x86: Fixed NULL function pointer dereference in AMD microcode patch loader.

Dereference took place in code part responsible for manual installation
of microcode patches through /dev/cpu/microcode.

Signed-off-by: Peter Oruba <peter.oruba@amd.com>
Cc: Peter Oruba <peter.oruba@amd.com>
Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

arch/x86/kernel/microcode.c
... ... @@ -127,7 +127,8 @@
127 127 old = current->cpus_allowed;
128 128  
129 129 while ((cursor = microcode_ops->get_next_ucode(&new_mc, cursor)) > 0) {
130   - error = microcode_ops->microcode_sanity_check(new_mc);
  130 + if (microcode_ops->microcode_sanity_check != NULL)
  131 + error = microcode_ops->microcode_sanity_check(new_mc);
131 132 if (error)
132 133 goto out;
133 134 /*