x86/mcheck: Be prepared for a rollback back to the ONLINE state
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 10 Nov 2016 17:44:43 +0000 (18:44 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 16 Nov 2016 08:34:17 +0000 (09:34 +0100)
commit7f34b935e8bf2f5304fce273a8fa98c63886d686
tree4c95cdb4f7f169133d1dcfe46e904149391c5525
parentec553abb318d75b1eafd275c71125569fa13b33b
x86/mcheck: Be prepared for a rollback back to the ONLINE state

If we try a CPU down and fail in the middle then we roll back to the
online state. This means we would perform CPU_ONLINE / mce_device_create()
without invoking CPU_DEAD / mce_device_remove() for the cleanup of what was
allocated in CPU_ONLINE.

Be prepared for this and don't allocate the struct if we have it
already.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Borislav Petkov <bp@alien8.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: rt@linutronix.de
Cc: linux-edac@vger.kernel.org
Link: http://lkml.kernel.org/r/20161110174447.11848-4-bigeasy@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/kernel/cpu/mcheck/mce_amd.c