mm/memory_hotplug: do not unlock after failing to take the device_hotplug_lock
Subsystems (3)
PATCH 6/16 mm/memory_hotplug: do not unlock after failing to take the device_hotplug_lock
From: zhong jiang <[email protected]>
Subject: mm/memory_hotplug: do not unlock after failing to take the device_hotplug_lock
When adding memory by probing a memory block in the sysfs interface, there is an obvious issue where we will unlock the device_hotplug_lock when we failed to takes it.
That issue was introduced in 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock").
We should drop out in time when failing to take the device_hotplug_lock.
Fixes 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock")
Signed-off-by zhong jiang <[email protected]>
Reported-by Yang yingliang <[email protected]>
Acked-by Michal Hocko <[email protected]>
Reviewed-by David Hildenbrand <[email protected]>
Reviewed-by Oscar Salvador <[email protected]>
Cc <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/memory.c renamed from drivers/base/memory.c~mm-memory_hotplug-do-not-unlock-when-fails-to-take-the-device_hotplug_lock +1 -1
@@ -506,7 +506,7 @@ static ssize_t probe_store(struct device 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,
_