From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755082AbcH0IDn (ORCPT ); Sat, 27 Aug 2016 04:03:43 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:2581 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754782AbcH0IDi (ORCPT ); Sat, 27 Aug 2016 04:03:38 -0400 Subject: Re: [PATCH v7 03/14] arm64/numa: add nid check for memory block To: Will Deacon References: <1472024693-12912-1-git-send-email-thunder.leizhen@huawei.com> <1472024693-12912-4-git-send-email-thunder.leizhen@huawei.com> <20160826123929.GA30302@arm.com> CC: Catalin Marinas , linux-arm-kernel , linux-kernel , Rob Herring , "Frank Rowand" , devicetree , Zefan Li , Xinwei Hu , Tianhong Ding , Hanjun Guo From: "Leizhen (ThunderTown)" Message-ID: <57C148FF.3060506@huawei.com> Date: Sat, 27 Aug 2016 16:02:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160826123929.GA30302@arm.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.23.164] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.57C14907.0121,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 5c22a55fca8d5d9ecaad8be7ecc033ed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/8/26 20:39, Will Deacon wrote: > On Wed, Aug 24, 2016 at 03:44:42PM +0800, Zhen Lei wrote: >> Use the same tactic to cpu and numa-distance nodes. >> >> Signed-off-by: Zhen Lei >> --- >> drivers/of/of_numa.c | 5 +++++ >> 1 file changed, 5 insertions(+) > > The subject has arm64/numa, but this is clearly core OF code and I originally added below check in arch/arm64/mm/numa.c, until Hanjun Guo told me that it should move into drivers/of/of_numa.c I forgot updating this. > requires an ack from Rob. > > The commit message also doesn't make much sense to me. > >> diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c >> index 7b3fbdc..afaeb9c 100644 >> --- a/drivers/of/of_numa.c >> +++ b/drivers/of/of_numa.c >> @@ -75,6 +75,11 @@ static int __init of_numa_parse_memory_nodes(void) >> */ >> continue; >> >> + if (nid >= MAX_NUMNODES) { >> + pr_warn("NUMA: Node id %u exceeds maximum value\n", nid); >> + return -EINVAL; >> + } > > Do you really want to return from the function here? Shouldn't we at least > of_node_put(np), i.e. by using a break; ? Thanks for pointing out this mistake. I will change to "r = -EINVAL" in the next version. > > Will > > . >