Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4555521imu; Tue, 8 Jan 2019 02:12:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN7U3MhF5v/TVSCfoV5zSwFerFMwmBtvwFJaI6+XMvZlbtfWZQ/DLkO6oFj3WnBoImQRjcn+ X-Received: by 2002:a17:902:e012:: with SMTP id ca18mr1139245plb.218.1546942364665; Tue, 08 Jan 2019 02:12:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546942364; cv=none; d=google.com; s=arc-20160816; b=Bfn3tSgamVtF7/mD0dW58zUou5KMBG3VbRWhiOxfQopnuW37DNvKZ0uN+QGqfIoD0I g8bDLZHVNSj3zh7KzINg76plAvBP03tHQiLehyJbV7vCWpUJ2UlMVNTAnyauNDnggkw6 PPjSxLZ+ZtAuqUhUvvgPs1aMoqAcIk/MhidIqre75SKoRj/vnCKgZ4StF6jwui0l7Ycn Qy8uxMzcp2NcHCWGCAGLnw9lMhO19YXrFUqthB1Jl/vV9wGB3Gjppy1AHUYiXplWLKgk iPk5Q9zWi1LedeZtfQ1bB/jRLVaDudFOMZrYHwi6gXqv9i2l4m8s/df0TS4IB+QvzIUw zTFw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=i9ecYqzbCeKIJCBsC0nVQtWIOhPzWCoGLpJaxVcUuig=; b=cf70gZleaGvbNnEP75WL74zQvNgXkNWIhzLQ5/Ju1X3oXvFlAPYAFTlL5mrh84SDzO YqHdNeOTgjDxq5vI0AiyEVXxkvXuLcOH87bF9WSvyCPf8eT0wZqCocwJePXgq0UOg7Z6 +wjIgHzCBIt5ylkEfGv+aGBHn5TOJXXNBSxnNzjnnzeVD7fy8qHcQP3AqrFrQd+JB/fx x3c/SJh3nXmQ2sNTIMjrTagyXfFSe94OiaVZnoqI6LAqOPeBcluxDaJdHnFDz9SWrnbD iJgEsHmhGjEk6ZrP8xZ0/hZZf6kGEtcFMILlBYMrgPyZIsZjkiaaFM/ryULkb3obU9FT gSWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=qZtn5S8u; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b131si51271629pga.394.2019.01.08.02.12.28; Tue, 08 Jan 2019 02:12:44 -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=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=qZtn5S8u; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728404AbfAHKKO (ORCPT + 99 others); Tue, 8 Jan 2019 05:10:14 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:48841 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727992AbfAHKKO (ORCPT ); Tue, 8 Jan 2019 05:10:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1546942213; x=1578478213; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=1P8JDvo3dAoiLl00jnPlAemozrC3mVJkmqYB5frnj3k=; b=qZtn5S8uFWkyfCTxQTb7McGwV5r5CceCH074Vuv3+9xziLNg2aJgikmu MkPYQS5i3RsO3u0cojAsD2OMXM5xF3cxIYOdncBsakc9AWLVGVNH2YSCH 2Kw7/UhwdbYAjxO8RbWm6MSauXB5R8/Ra4PWW77ZAkxMvN/3Rzz40wiXg gws8AISHAAYslyirDtA1xDtDJxpta7atUNSmesF08xUjibiWoUJt1HhHJ OI8CVNZ+OSOYH0Qo3Bo3yR01p/W1etlh+4SOS5oLsa0NKWjLQ11kHm/XS uqwPqfOfgDG9xXvDNUHE7Dav/nZ/tu2GCZ2CH91WqiajjAYnxWStEwoxd w==; X-IronPort-AV: E=Sophos;i="5.56,453,1539619200"; d="scan'208";a="103169116" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 08 Jan 2019 18:10:13 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 08 Jan 2019 01:51:46 -0800 Received: from usa003532.ad.shared (HELO [10.86.59.202]) ([10.86.59.202]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Jan 2019 02:10:13 -0800 Subject: Re: [PATCH] RISC-V: fix bad use of of_node_put To: Andreas Schwab Cc: "linux-riscv@lists.infradead.org" , "palmer@sifive.com" , "linux-kernel@vger.kernel.org" , "anup@brainfault.org" , "jeremy.linton@arm.com" , "sudeep.holla@arm.com" References: <1542755270-10433-1-git-send-email-atish.patra@wdc.com> From: Atish Patra Message-ID: <6326f9ba-695d-dc00-1b0c-c37a94c9b485@wdc.com> Date: Tue, 8 Jan 2019 02:10:12 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/7/19 6:16 AM, Andreas Schwab wrote: > of_find_node_by_type already calls of_node_put, don't call it again. > > Fixes: 94f9bf118f ("RISC-V: Fix of_node_* refcount") > Signed-off-by: Andreas Schwab > --- > arch/riscv/kernel/smpboot.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c > index fc185ecabb..18cda0e8cf 100644 > --- a/arch/riscv/kernel/smpboot.c > +++ b/arch/riscv/kernel/smpboot.c > @@ -57,15 +57,12 @@ void __init setup_smp(void) > > while ((dn = of_find_node_by_type(dn, "cpu"))) { > hart = riscv_of_processor_hartid(dn); > - if (hart < 0) { > - of_node_put(dn); > + if (hart < 0) > continue; > - } > > if (hart == cpuid_to_hartid_map(0)) { > BUG_ON(found_boot_cpu); > found_boot_cpu = 1; > - of_node_put(dn); > continue; > } > > @@ -73,7 +70,6 @@ void __init setup_smp(void) > set_cpu_possible(cpuid, true); > set_cpu_present(cpuid, true); > cpuid++; > - of_node_put(dn); > } > > BUG_ON(!found_boot_cpu); > Thanks for catching and fixing this. Reviewed-by: Atish Patra Regards, Atish