]> git.baikalelectronics.ru Git - kernel.git/commit
driver core: Release device_hotplug_lock when store_mem_state returns EINVAL
authorYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Fri, 11 Oct 2013 06:36:25 +0000 (15:36 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2013 01:42:41 +0000 (18:42 -0700)
commitcc231eb99835a0d563967495ea0783cb73e675e9
tree98ba5fa9043c6e141630e205cb84fcbcfb3d0225
parent065f53a8c7da184ea1803e0dbc86865d5e221b37
driver core: Release device_hotplug_lock when store_mem_state returns EINVAL

When inserting a wrong value to /sys/devices/system/memory/memoryX/state file,
following messages are shown. And device_hotplug_lock is never released.

================================================
[ BUG: lock held when returning to user space! ]
3.12.0-rc4-debug+ #3 Tainted: G        W
------------------------------------------------
bash/6442 is leaving the kernel with locks still held!
1 lock held by bash/6442:
 #0:  (device_hotplug_lock){+.+.+.}, at: [<ffffffff8146cbb5>] lock_device_hotplug_sysfs+0x15/0x50

This issue was introdued by commit 81ced10 (drivers: base: use standard
device online/offline for state change).

This patch releases device_hotplug_lcok when store_mem_state returns EINVAL.

Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
CC: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/memory.c