From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2602FC43218 for ; Fri, 26 Apr 2019 05:19:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EEBFD2084F for ; Fri, 26 Apr 2019 05:19:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556255981; bh=pTIbg2ocs71DAtOqJxLEZpQk11AvQlPPGDJQeNn8zYA=; h=Subject:To:From:Date:List-ID:From; b=Ho8MZngvvzIclQ2K36Ht1XEvOmU3v2xCgvd5pZ37xs0LXbb0Q/qMkXtHeMprFASRR rlCGwOgMo5HeapRJVFkrJiXiFgA/9QVLWSNALwFrc+5fj658wH8pcJsrzlvtKJtbYJ +RjquZjtpOaJnCx7ucBEbVvmlHSR0uLbSJXjGztY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727174AbfDZFTk (ORCPT ); Fri, 26 Apr 2019 01:19:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:45152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbfDZFTj (ORCPT ); Fri, 26 Apr 2019 01:19:39 -0400 Received: from localhost (62-193-50-229.as16211.net [62.193.50.229]) (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 908782077B; Fri, 26 Apr 2019 05:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556255979; bh=pTIbg2ocs71DAtOqJxLEZpQk11AvQlPPGDJQeNn8zYA=; h=Subject:To:From:Date:From; b=mc6FFHN4dEAoif62USODtdYt1Ze5D1FzBJfkKkczxCaRY8KPXqTEfbZoPaR2XQ5d0 odaIovm0OGyHVEYKrTK8e0mcHvyjuEMlGUUbGPyPhWem3wBuixsNuBEcudzNiEH+ur XdRu7vL4W1b8BAqfQEEsKcBN8BmYvZQ+Mf+y0RZQ= Subject: patch "mm/memory_hotplug: Do not unlock when fails to take the" added to driver-core-next To: zhongjiang@huawei.com, david@redhat.com, gregkh@linuxfoundation.org, mhocko@suse.com, osalvador@suse.de, stable@vger.kernel.org, yangyingliang@huawei.com From: Date: Fri, 26 Apr 2019 07:19:30 +0200 Message-ID: <15562559704991@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled mm/memory_hotplug: Do not unlock when fails to take the to my driver-core git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git in the driver-core-next branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will also be merged in the next major kernel release during the merge window. If you have any questions about this process, please let me know. >From d2ab99403ee00d8014e651728a4702ea1ae5e52c Mon Sep 17 00:00:00 2001 From: zhong jiang Date: Mon, 8 Apr 2019 12:07:17 +0800 Subject: mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock 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 --- 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 cb8347500ce2..e49028a60429 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -506,7 +506,7 @@ static ssize_t 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.21.0