Skip to content

Commit

Permalink
kobj: fix threshold_init_device/kobject_uevent_env oops
Browse files Browse the repository at this point in the history
the logic in this function is just crazy.  It's recursive, but we
can circumvent the creation for the kobject and whole creation of the
threshold_block if some conditions are met.  That's why we see the
allocate_threshold_blocks so many times in the callstack, yet only a few
kobjects created.

Then we blow up in kobject_uevent_env() on the first debug printk.
Which means that we are just passing in garbage.

Man, this is one time that comments in code would have been very nice to
have, and why forward goto's into major code blocks are just evil...

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Greg KH authored and Ingo Molnar committed Jan 30, 2008
1 parent 85004cc commit 213eca7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kernel/cpu/mcheck/mce_amd_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 213eca7

Please sign in to comment.