summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2019-04-08 12:07:17 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-28 18:29:02 +0100
commit4a34dcf258afd8854a4d4c2741fdad01e4e784f2 (patch)
tree3c822ae3ac0f2b23937e084ef59e0ca0e0a3b94d /drivers/base
parentcb92a5c2cd39cad6992c9741dcb7908bb3d2e074 (diff)
mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock
[ Upstream commit d2ab99403ee00d8014e651728a4702ea1ae5e52c ] When adding the memory by probing memory block in sysfs interface, there is an obvious issue that we will unlock the device_hotplug_lock when fails to takes it. That issue was introduced in Commit 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock") We should drop out in time when fails to take the device_hotplug_lock. Fixes: 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock") Reported-by: Yang yingliang <yangyingliang@huawei.com> Signed-off-by: zhong jiang <zhongjiang@huawei.com> Reviewed-by: Oscar Salvador <osalvador@suse.de> Reviewed-by: David Hildenbrand <david@redhat.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 9f96f1b43c15..6a3694a4843f 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -502,7 +502,7 @@ memory_probe_store(struct device *dev, struct device_attribute *attr,
ret = lock_device_hotplug_sysfs();
if (ret)
- goto out;
+ return ret;
nid = memory_add_physaddr_to_nid(phys_addr);
ret = __add_memory(nid, phys_addr,