Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2497130yba; Sun, 7 Apr 2019 21:02:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwcX2lMI0yOa3p0mWP83NmU6Pc2L9p9aC3RW+zL4Wiy3CZTc3T2GxbAeokdNicmuOtOC6g X-Received: by 2002:a65:608a:: with SMTP id t10mr15348969pgu.125.1554696153906; Sun, 07 Apr 2019 21:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554696153; cv=none; d=google.com; s=arc-20160816; b=OSAbAVNss3JKSe6G0nV+MRgFfir3t1EIc73Zq+rxVOMnVZ5VsqbQOa1H3nirtXYNIB aaVEenBtHHovtG3AwgxVCqJLbWEO1OBpIcBn2xPwmP5KEzknGHl4/tLb5pX/FGytA7sl ssX4u8uRX6STpazT93JRb43dJbzUQAxBsp53jMfCRZN4KqjMvyA1O7LrBpRkq+dvviRf DVXNDq3AEuAGtPIQiYSZcQ8syZZtBW2+6za7znYQm7ONsAogdiM9nFecXR6J+izgi2ye NXmtKyRoX2GCHgljwpcj5/PHnRUZvRv+DU8sgQ+TkBNKtVMvniwL956aeJoVKhLtB+Dr FOWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=DA77fJJZNzFcVQ67Xv2AKBK4HG/jjq7O5rfax4q9kUA=; b=pW5L0jUZY9WFdjDX84CHiloUUnigoOQXcP7kUqIa5U4oY5hWcdnsWyxIGYFiyLCKVW nBcg4PFENNryT3wHi2V4BXlEPuee+4h29p6EUXyDYMzOPrRGQ9hvY9tL7pA72TvC+6Ki hLZb1LGD9MgS+iLix7K3m7cmE23wjCPHyCB6jIn5DNjv9xPXOm4Ay6GOXKYkMeHCiqgx n36znTU2PcmuNNIxnfLex2re1R0pd49MxeeEnLnA/dSQQi2RuvDS9p4Gj5X4yv/E2E+x 8ODVkuooA08+lFeaWge1nFcyBb3sj/GXn94nsG073rCnoPFoSEKjNz/X56YEx9ixkrX5 lWjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si26018750plj.345.2019.04.07.21.02.17; Sun, 07 Apr 2019 21:02:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725933AbfDHEBe (ORCPT + 99 others); Mon, 8 Apr 2019 00:01:34 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:58124 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725854AbfDHEBd (ORCPT ); Mon, 8 Apr 2019 00:01:33 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id CC375D64260818A7C064; Mon, 8 Apr 2019 12:01:31 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.408.0; Mon, 8 Apr 2019 12:01:22 +0800 From: zhong jiang To: , , , , , CC: , , , , , , Subject: [PATCH] mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock Date: Mon, 8 Apr 2019 12:00:12 +0800 Message-ID: <1554696012-9254-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: zhong jiang --- drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/memory.c b/drivers/base/memory.c index d9ebb89..8b0cec7 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -507,7 +507,7 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr, ret = lock_device_hotplug_sysfs(); if (ret) - goto out; + goto ret; nid = memory_add_physaddr_to_nid(phys_addr); ret = __add_memory(nid, phys_addr, -- 1.7.12.4