The patch titled Subject: mm/memory_hotplug: do not unlock after failing to take the device_hotplug_lock has been added to the -mm tree. Its filename is mm-memory_hotplug-do-not-unlock-when-fails-to-take-the-device_hotplug_lock.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-memory_hotplug-do-not-unlock-when-fails-to-take-the-device_hotplug_lock.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-memory_hotplug-do-not-unlock-when-fails-to-take-the-device_hotplug_lock.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: zhong jiang <zhongjiang@xxxxxxxxxx> 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. Link: http://lkml.kernel.org/r/1554696437-9593-1-git-send-email-zhongjiang@xxxxxxxxxx Fixes: 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock") Signed-off-by: zhong jiang <zhongjiang@xxxxxxxxxx> Reported-by: Yang yingliang <yangyingliang@xxxxxxxxxx> Acked-by: Michal Hocko <mhocko@xxxxxxxx> Reviewed-by: David Hildenbrand <david@xxxxxxxxxx> Reviewed-by: Oscar Salvador <osalvador@xxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/base/memory.c~mm-memory_hotplug-do-not-unlock-when-fails-to-take-the-device_hotplug_lock +++ a/drivers/base/memory.c @@ -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, _ Patches currently in -mm which might be from zhongjiang@xxxxxxxxxx are mm-memory_hotplug-do-not-unlock-when-fails-to-take-the-device_hotplug_lock.patch