Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3736482imu; Mon, 7 Jan 2019 08:32:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN68DD87SgpZLc3w7n04MNHRwLtHEePDkFfpgUuqq2MnGmVPF4xy4mqLsg+XubSPXmBl7Wup X-Received: by 2002:a63:b543:: with SMTP id u3mr11403165pgo.420.1546878753021; Mon, 07 Jan 2019 08:32:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546878752; cv=none; d=google.com; s=arc-20160816; b=dLSseMWEDtbUGiUISAGP2mJpwMbm3Bpb5k/O29ksbs/AI0Fggjqjaj+2xqMkccSc5M Stj16teKxWAREL4D3jtES0yP5qEh9IAPkvECPYlSh33Hq1aTeQpNMCqEUo1NrUt4pCoW QzPLHNBJwre1CCQwIm93pFsqQnOO337Ot1Bx1Z0ibkbBYQCxTFVZpUoaS/yWSyLBdioS b2E8W72xjnLF5ktG4UGsTdlBJpo5gtq7R3qcVPbtI2qaRjZ3z6RDydRxkscq3kaUpzIn amGASevbrhOuOKgU4cRBC9jdWxT+3lY87Hw5Apgnb8ehe47zdRRtypu1GMvAKzrpjDRT MLTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=zpgg1fJwJ5frx24ErgpFbpeV35ZQoiPe69HYfZoazKo=; b=J72tzTJz+qxvBs3JRCxeIOBuEHLw3GwmZ74zTYd1QHWVzcMQwE6kmpksH1VRxFpuDT +RMN+N2ZdXuj1IgvNQhCFlbc+Q8RmgNNFFqK7k0qa1tl8mibwoLs9k9CQfC2kL7x+VRB 9ILknQFGTLDBHcWNeOb7d9u8R4WrPn8TCHxzLu3++cVl32p4/eEZO1hT3ZIByeLUtYdy /M3plZSqN+vx78CZuhBYhl0w+CxpokTDgPSoFKJPi8mHbPEJz81iZ7MJSPq1kX0PGGe4 DCcX8msrSZQqj5W0n10N0+Grh6qiuIyMPHlYb/ZurT+LuuGZPYXjDq/Vc5r1lH0ZT44v Nn3Q== 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 s12si4177030pgh.395.2019.01.07.08.32.17; Mon, 07 Jan 2019 08:32:32 -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; 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 S1727517AbfAGOQi (ORCPT + 99 others); Mon, 7 Jan 2019 09:16:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:54670 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727119AbfAGOQi (ORCPT ); Mon, 7 Jan 2019 09:16:38 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id EAEA5AC4E; Mon, 7 Jan 2019 14:16:36 +0000 (UTC) From: Andreas Schwab To: Atish Patra 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 Subject: [PATCH] RISC-V: fix bad use of of_node_put References: <1542755270-10433-1-git-send-email-atish.patra@wdc.com> X-Yow: I will establish the first SHOPPING MALL in NUTLEY, New Jersey... Date: Mon, 07 Jan 2019 15:16:35 +0100 In-Reply-To: <1542755270-10433-1-git-send-email-atish.patra@wdc.com> (Atish Patra's message of "Tue, 20 Nov 2018 15:07:50 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.20.1 -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."