Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5996682ybc; Wed, 27 Nov 2019 13:07:12 -0800 (PST) X-Google-Smtp-Source: APXvYqzTrBuggazBAvOwy7QRqXJNtHfVYJIqu5wze4FmcKb4otzP08qqgJfj4B3zstrzS7mo7yK4 X-Received: by 2002:a17:906:680b:: with SMTP id k11mr1349000ejr.0.1574888832374; Wed, 27 Nov 2019 13:07:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888832; cv=none; d=google.com; s=arc-20160816; b=Pc7XI3n6TCuRizgHHXexliov3CiG9Z7oQvbgKpOs5DSvBC8xebhtY0id2oXb9oJN53 hfjTevLTzH6jX728bksoxE8ZVNAXEjc+/S643nMJ+xaW3RedeZpmLzFojkRa3aBjTrVw rRIjuNp0I3OaIKhjdvTNjq9KJXDgE0BXMaNuMyAeyq8E4N0mDAz4A20SgL+UW5IwBM9R DlxWwH7he+n2CV2vksjhA6SaUMujhVlezVZ67C2G9KrurOK6rglwPjj22sgQvdsvopzt JLfATriP0XD1CqoofZL9VQ8p55PDDIzgqAgRFij7/kTVFytSuoW4S0m/TTbt1yfta6ja uJeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vDsiCLUrKGKcnxMEAIuLXniQ4sQSSkp6BIXbjhlMFdg=; b=bl0fcDtqVsIcg2fnieieUoXYxgPEKibp2wLhnzDcliSOLD5jGB4CNf9iCWERs9f5eU guNqRc/kZmblFkwaxqQrAN3P9w9iPe3yjo09yrz/TjgxhaKRWZMfd9+7cm4dKwYF5UxL UNA0SR3LPaA1IjWOd9xcw0TK88wyAtyCdyCZ/bV+Ao5O4aPnDCYSZQmtHUUlpZzczhRx es7wL9QxSz9N4Bwu/jNS7nkn59A3Ka1fBY5O3cheLaba6IPVqGlUnOU4h4RFY2NMg4F2 YSUyEhj+yZV/1ZbC9UZm59XJJqe62bWA7TZ4Kf0IaAtuBkcA04Ib8mKaNPCy4BTaDjdN G7TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UPfSXNBH; 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 v11si10193852eja.168.2019.11.27.13.06.48; Wed, 27 Nov 2019 13:07:12 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=UPfSXNBH; 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 S1732323AbfK0VFq (ORCPT + 99 others); Wed, 27 Nov 2019 16:05:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:59468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732316AbfK0VFk (ORCPT ); Wed, 27 Nov 2019 16:05:40 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B3C2C2166E; Wed, 27 Nov 2019 21:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888740; bh=L4QbWVzfIJSe4VDi2e6Gwm+s3G1sQIYBlYSwyB3DNpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UPfSXNBHUa4hoTSDRvezj+M+469pUvnjz/dc6TyhL0tZtFuVbQEUqrIPNURJpAMpG Q+ztgexF7P2tLy8H1ykbY6o96D6K+D4KYGtdMdp80P5es9oXr3C8fW6viHdSAFP500 2/vjvZd0CaxF0WQJzrVWt8yWvdaFCT/q9mci2gfk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yang yingliang , zhong jiang , Oscar Salvador , David Hildenbrand , Michal Hocko , Sasha Levin Subject: [PATCH 4.19 252/306] mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock Date: Wed, 27 Nov 2019 21:31:42 +0100 Message-Id: <20191127203133.302148471@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: zhong jiang [ 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 Signed-off-by: zhong jiang Reviewed-by: Oscar Salvador Reviewed-by: David Hildenbrand Acked-by: Michal Hocko Cc: stable Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 0f8e77f78cc80..ac1574a696100 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -510,7 +510,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, -- 2.20.1