diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-10-17 10:39:01 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-10-17 10:39:01 -0700 |
commit | 83f11a9cf2578b104c0daf18fc9c7d33c3d6d53a (patch) | |
tree | 4b884381e2686db8e0b33a6b17cdbc5af7c0a12c | |
parent | 02a3250fd39e3ad7568acc296e8d4d2d265c3def (diff) | |
parent | a37f86305c80f441b8b99dae7c19d3f9d2effc15 (diff) |
Merge tag 'driver-core-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fix from Greg KH:
"Here is one fix for the hotplug memory path that resolves a regression
when removing memory that showed up in 3.12-rc1"
* tag 'driver-core-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
driver core: Release device_hotplug_lock when store_mem_state returns EINVAL
-rw-r--r-- | drivers/base/memory.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 9e59f6535c4..bece691cb5d 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -333,8 +333,10 @@ store_mem_state(struct device *dev, online_type = ONLINE_KEEP; else if (!strncmp(buf, "offline", min_t(int, count, 7))) online_type = -1; - else - return -EINVAL; + else { + ret = -EINVAL; + goto err; + } switch (online_type) { case ONLINE_KERNEL: @@ -357,6 +359,7 @@ store_mem_state(struct device *dev, ret = -EINVAL; /* should never happen */ } +err: unlock_device_hotplug(); if (ret) |