From 404aae5d420ec543e2e8434f7ec0edf5e2d2b0c4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 27 Jan 2008 10:29:20 -0800 Subject: [PATCH] x86: fix runtime error in arch/x86/kernel/cpu/mcheck/mce_amd_64.c 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 for reporting the problem and testing. Cc: Yinghai Lu Cc: Jacob Shin Cc: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/mcheck/mce_amd_64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c index 753588755fee..073afa7dd89a 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 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu, if (err) goto out_free; - kobject_uevent(&b->kobj, KOBJ_ADD); + if (b) + kobject_uevent(&b->kobj, KOBJ_ADD); return err; -- GitLab