[PATCH 2/5] x86: fix runtime error in arch/x86/kernel/cpu/mcheck/mce_amd_64.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg Kroah-Hartman
Date: Sunday, January 27, 2008 - 4:38 pm

This problem is due to the kobject rework recently done in this file.

The mce_amd_64.c code uses some wierd forward calls to back out of the
recursive way the code creates kobjects.  Because of this, we need to
verify that we have really created a kobject before calling
kobject_uevent().

Many thanks to Yinghai Lu <yhlu.kernel@gmail.com> for reporting the
problem and testing.

Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Jacob Shin <jacob.shin@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/x86/kernel/cpu/mcheck/mce_amd_64.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
index 7535887..073afa7 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
@@ -450,7 +450,8 @@ recurse:
 	if (err)
 		goto out_free;
 
-	kobject_uevent(&b->kobj, KOBJ_ADD);
+	if (b)
+		kobject_uevent(&b->kobj, KOBJ_ADD);
 
 	return err;
 
-- 
1.5.3.8

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

Messages in current thread:
[GIT PATCH] driver core fixes against 2.6.24, Greg KH, (Sun Jan 27, 4:37 pm)
[PATCH 1/5] Driver core: Fix up build when CONFIG_BLOCK=N, Greg Kroah-Hartman, (Sun Jan 27, 4:38 pm)
[PATCH 2/5] x86: fix runtime error in arch/x86/kernel/cpu/ ..., Greg Kroah-Hartman, (Sun Jan 27, 4:38 pm)
[PATCH 3/5] Module: check to see if we have a built in mod ..., Greg Kroah-Hartman, (Sun Jan 27, 4:38 pm)
[PATCH 4/5] Driver core: add bus_find_device_by_name function, Greg Kroah-Hartman, (Sun Jan 27, 4:38 pm)
[PATCH 5/5] PPC: Fix powerpc vio_find_name to not use devi ..., Greg Kroah-Hartman, (Sun Jan 27, 4:38 pm)