• Akinobu Mita's avatar
    cpu hotplug: mce: fix cpu hotplug error handling · d435d862
    Akinobu Mita authored
    - Clear kobject in percpu device_mce before calling sysdev_register() with
      Because mce_create_device() may fail and it leaves kobject filled with
      junk. It will be the problem when mce_create_device() will be called
      next time.
    - Fix error handling in mce_create_device()
      Error handling should not do sysdev_remove_file() with not yet added
    - Don't register hotcpu notifier when mce_create_device() returns error
    - Do mce_create_device() in CPU_UP_PREPARE instead of CPU_ONLINE
    Cc: Andi Kleen <andi@firstfloor.org>
    Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
    Cc: Gautham R Shenoy <ego@in.ibm.com>
    Cc: Oleg Nesterov <oleg@tv-sign.ru>
    Cc: Andi Kleen <ak@suse.de>
    Cc: Jan Beulich <jbeulich@novell.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>