]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cpu/hotplug: Drop the device lock on error
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 2 Jun 2017 14:27:14 +0000 (16:27 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 3 Jun 2017 07:35:04 +0000 (09:35 +0200)
commit40da1b11f01e43aad1aa6cea64681b6125e8a2a7
tree8a7c467a91c77dcab9f1102b1a3ad755c7c4ea9b
parent104c08ba8e921ef97abfdc10408d54921a6d9003
cpu/hotplug: Drop the device lock on error

If a custom CPU target is specified and that one is not available _or_
can't be interrupted then the code returns to userland without dropping a
lock as notices by lockdep:

|echo 133 > /sys/devices/system/cpu/cpu7/hotplug/target
| ================================================
| [ BUG: lock held when returning to user space! ]
| ------------------------------------------------
| bash/503 is leaving the kernel with locks still held!
| 1 lock held by bash/503:
|  #0:  (device_hotplug_lock){+.+...}, at: [<ffffffff815b5650>] lock_device_hotplug_sysfs+0x10/0x40

So release the lock then.

Fixes: 757c989b9994 ("cpu/hotplug: Make target state writeable")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20170602142714.3ogo25f2wbq6fjpj@linutronix.de
kernel/cpu.c