]> git.baikalelectronics.ru Git - kernel.git/commit
cpu/hotplug: Prevent overwriting of callbacks
authorThomas Gleixner <tglx@linutronix.de>
Wed, 21 Dec 2016 19:19:49 +0000 (20:19 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 25 Dec 2016 09:47:42 +0000 (10:47 +0100)
commit17d5c06f7de86dae490d8b7c3e83ed2c812fa3b4
tree61223479925f5c46c38a7e0419e8e0058c39c84f
parenta2bb9e3c8bba6abf19cec6e2f3bb2ec1966bd456
cpu/hotplug: Prevent overwriting of callbacks

Developers manage to overwrite states blindly without thought. That's fatal
and hard to debug. Add sanity checks to make it fail.

This requries to restructure the code so that the dynamic state allocation
happens in the same lock protected section as the actual store. Otherwise
the previous assignment of 'Reserved' to the name field would trigger the
overwrite check.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Link: http://lkml.kernel.org/r/20161221192111.675234535@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/cpu.c