x86: fix runtime error in arch/x86/kernel/cpu/mcheck/mce_amd_64.c
authorGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Jan 2008 18:29:20 +0000 (10:29 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Jan 2008 23:01:39 +0000 (15:01 -0800)
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

index 7535887..073afa7 100644 (file)
@@ -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;