Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp524895imm; Fri, 17 Aug 2018 02:02:16 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwfb8LzHCI7rkWVDlhhkT+w9O2ZOsWfkAnFdo79QPm9ANS+qt41LvnjJYp30kBr7zYneJcL X-Received: by 2002:a63:5866:: with SMTP id i38-v6mr32188661pgm.63.1534496536538; Fri, 17 Aug 2018 02:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534496536; cv=none; d=google.com; s=arc-20160816; b=YuBqundXDSs4W3UU6gsJ+r3Mbh7nL/XKictabBzRbwxSG04ZpCEkPWZbxI1pWpKXwg pg9h+nsEkt3n/n/HxZZfWaZmLCRjhOq3GHBwgt9ao9DsCtlTbOaH0FsAkqDPIPCo1cDe pBVK9fjvMlnoHB/uJjYAevvtgmCGwqrZfbBwsTH/XOEoGf+KUOAvJAIB6be6JqpbZJkK t07/IiPO8pAE/Jo5x61KxvVG6H8FvSoscDlDq2uUCGUh5tM6Fy5QfD4jcpok24myiy25 AfyVV6RP9bIyGAXYnkgBM+7yX7oha+cve95y5iWsYRzgB7Xq+9xIPLUAA6HcAOrCY+Rw J8vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=3ECCH/k6jiVWi1l5eaaCRKhrwOJOvg2mUyo3PfA9i7w=; b=Mq5HHOThAUT3xuc60m5huRM6QAjMZAW3KF24Xdly2QLy1Na1nr7bHZzL2F3nChUNMs m9XJXVD+aOvRqzUGBIc2yLu5vk4/q+T6I7tsH+0qW2u4xtzYxsER/2br7MJxZmGnjAJ+ bnxSgdwU9pdK/uQs9k/7MsDZs/tTcPfxi5zR9Yw/KRoJr/vB26Bsg3g6CszPKdMVTOtz cnTjr2i6nPqS5Xq/hrdxcq+HoaDqirbgA9NktkqPMVt4c/Flt53jqvgtUY2Hp/9PG7Tl 9AxB+f6Z5n1ma2OHbyZlge/P9S5BvajhjaTQ6F5exm5BB0bS05HVAwuIJYXi0G6LjcpX a8LA== 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 d10-v6si1695894plo.343.2018.08.17.02.02.01; Fri, 17 Aug 2018 02:02:16 -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 S1726578AbeHQMDA (ORCPT + 99 others); Fri, 17 Aug 2018 08:03:00 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:53247 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbeHQMC7 (ORCPT ); Fri, 17 Aug 2018 08:02:59 -0400 Received: by mail-wm0-f66.google.com with SMTP id o11-v6so6853824wmh.2 for ; Fri, 17 Aug 2018 02:00:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3ECCH/k6jiVWi1l5eaaCRKhrwOJOvg2mUyo3PfA9i7w=; b=hK4DYq9RCqvG+no0PXFETowrpPnGxkHhYI1aAhPuvvtKShzNuovF2wJPo3DHmud2sl Rtgc0G4ySySr0e+ywsPl3chdmvVY/6wjV7avaCjTuZx4TeGpYKGrOmH9wBnsiKGqX9og v+juWUxKi0OBrsnGFC9DpSd9k90Ooprd0blhRE38ru5UDE9siFlPY4QsQDlEfY5OJrp9 i2Sz4+6FnwRtCwRutv20BrpwG3RImoH//xqS+acReCg5ecgFkC+8yz/fhpjW1UdzKHGO do9l+bhBuvvchuoWKfO7l2y3MkuI3HvaPeSSwTuIWmZn1cRpefQqwvdUbAUSdEzJj5ke N0Rg== X-Gm-Message-State: AOUpUlFJBY/lX2YaqO4UQuOHlo8Hqk9qbR/xWeeGPk0jgONjX39DVIRI 6QYu9+lD1i0JyDVhFNGBztA= X-Received: by 2002:a1c:6c03:: with SMTP id h3-v6mr17211304wmc.38.1534496423554; Fri, 17 Aug 2018 02:00:23 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id a84-v6sm4446308wmh.27.2018.08.17.02.00.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 02:00:22 -0700 (PDT) Received: from d104.suse.de (nat.nue.novell.com [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id 2B0A4124936; Fri, 17 Aug 2018 11:00:21 +0200 (CEST) From: Oscar Salvador To: akpm@linux-foundation.org Cc: mhocko@suse.com, vbabka@suse.cz, dan.j.williams@intel.com, yasu.isimatu@gmail.com, jonathan.cameron@huawei.com, david@redhat.com, Pavel.Tatashin@microsoft.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador Subject: [PATCH v4 2/4] mm/memory_hotplug: Drop mem_blk check from unregister_mem_sect_under_nodes Date: Fri, 17 Aug 2018 11:00:15 +0200 Message-Id: <20180817090017.17610-3-osalvador@techadventures.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180817090017.17610-1-osalvador@techadventures.net> References: <20180817090017.17610-1-osalvador@techadventures.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oscar Salvador Before calling to unregister_mem_sect_under_nodes(), remove_memory_section() already checks if we got a valid memory_block. No need to check that again in unregister_mem_sect_under_nodes(). If more functions start using unregister_mem_sect_under_nodes() in the future, we can always place a WARN_ON to catch null mem_blk's so we can safely back off. For now, let us keep the check in remove_memory_section() since it is the only function that uses it. Signed-off-by: Oscar Salvador Reviewed-by: Andrew Morton Reviewed-by: Pavel Tatashin Reviewed-by: David Hildenbrand --- drivers/base/node.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/base/node.c b/drivers/base/node.c index 1ac4c36e13bb..dd3bdab230b2 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -455,10 +455,6 @@ int unregister_mem_sect_under_nodes(struct memory_block *mem_blk, NODEMASK_ALLOC(nodemask_t, unlinked_nodes, GFP_KERNEL); unsigned long pfn, sect_start_pfn, sect_end_pfn; - if (!mem_blk) { - NODEMASK_FREE(unlinked_nodes); - return -EFAULT; - } if (!unlinked_nodes) return -ENOMEM; nodes_clear(*unlinked_nodes); -- 2.13.6