clockevents: Prevent clockevent_devices list corruption on cpu hotplug
authorThomas Gleixner <tglx@linutronix.de>
Thu, 10 Dec 2009 14:35:10 +0000 (15:35 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 11 Dec 2009 09:28:08 +0000 (10:28 +0100)
Xiaotian Feng triggered a list corruption in the clock events list on
CPU hotplug and debugged the root cause.

If a CPU registers more than one per cpu clock event device, then only
the active clock event device is removed on CPU_DEAD. The unused
devices are kept in the clock events device list.

On CPU up the clock event devices are registered again, which means
that we list_add an already enqueued list_head. That results in list
corruption.

Resolve this by removing all devices which are associated to the dead
CPU on CPU_DEAD.

Reported-by: Xiaotian Feng <dfeng@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Xiaotian Feng <dfeng@redhat.com>
Cc: stable@kernel.org

No differences found