[patch 2/2] [PATCH 2/2] x86: Fixed NULL function pointer dereference in AMD microcode patch loader.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Oruba
Date: Friday, August 1, 2008 - 3:46 am

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>
---
 arch/x86/kernel/microcode.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c
index 39961bb..ad136ad 100644
--- a/arch/x86/kernel/microcode.c
+++ b/arch/x86/kernel/microcode.c
@@ -127,7 +127,8 @@ static int do_microcode_update(void)
 	old = current->cpus_allowed;
 
 	while ((cursor = microcode_ops->get_next_ucode(&new_mc, cursor)) > 0) {
-		error = microcode_ops->microcode_sanity_check(new_mc);
+		if (microcode_ops->microcode_sanity_check != NULL)
+			error = microcode_ops->microcode_sanity_check(new_mc);
 		if (error)
 			goto out;
 		/*
-- 
1.5.4.5




--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 2/2] [PATCH 2/2] x86: Fixed NULL function pointer d ..., Peter Oruba, (Fri Aug 1, 3:46 am)