Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3734512imu; Mon, 7 Jan 2019 08:30:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN4T5xojnnaLU4lO+yRBJDy0XoQcXezmWz8oN7Oxpr8Z91aU58xsStRoib1KelTKIX0mo4zA X-Received: by 2002:a63:2ac9:: with SMTP id q192mr11515875pgq.58.1546878645286; Mon, 07 Jan 2019 08:30:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546878645; cv=none; d=google.com; s=arc-20160816; b=poXzCRu6gnRDa1wYDor9joyPWFUGJEbEkMtWDKBLUMapC+xYVMf6gTkBIjgu4fc/JY KJjs/Qm1pL7wo4kZwslBQR4hdsAIzbt0WFUlXDj7ou5b6vXbW7E8fUfZgVpU0Yw+JYp+ 6jN1pqauXckcs+KRodoFvSUKBV22Y7RU8I6CxkbhPF64D3Ou48VlC+TrdtaWEQKs30bt aYmhAJ6uaI//AanntAtM5UP4xVjTKj2/4YDWdKph8ChB1UfCQ1ksHaEU6USXQgf4fIea ThvAyG+dKLnU4jCV3LPEgO3rak9P/ur3XhX9xohrVdd76f1vJ5WXqsY+ASQp1uuFb+n1 nknQ== 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=ihpY/OixBkOmWCmXrBIKf91stUMLqYdtaXWTtRxmnhc=; b=BZu5KoH5U6e9o3XTJB0T7rWeYNXhkMnxNarY666oV7UgqlCHiZp72L3uHTYlnKC4BZ iXQU5yvblmk9Phi+OqAZawEpH5c9Gh0bPfBBTDmVPKyhfW0UO7tAYaoEV9OB5vBjU7PW hHzGa9oABcbWnGpQFt3ddNmIOr0vzD9GR9hzV/xsiES6d0x3EVZotAS53YCPJE0a18yP nREIBnGRDHCOvpNw+vn8Ji3BLC0WI832PyMSm17mkSJxilizgUqGeTpl1vt8DlmB3UqG Q9md9l/qI05aKu16hPzESrmW6FmsB6qbOPtqVudEfmDbI8DHyaajeb2p/kpjV5HqO8RS LBaA== 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 y141si3565215pfc.180.2019.01.07.08.30.29; Mon, 07 Jan 2019 08:30:45 -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 S1727775AbfAGNdH (ORCPT + 99 others); Mon, 7 Jan 2019 08:33:07 -0500 Received: from mx2.suse.de ([195.135.220.15]:45478 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726886AbfAGNdG (ORCPT ); Mon, 7 Jan 2019 08:33:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E219EAD43; Mon, 7 Jan 2019 13:33:04 +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: Re: [PATCH] RISC-V: Fix of_node_* refcount References: <1542755270-10433-1-git-send-email-atish.patra@wdc.com> X-Yow: Is this "BIKINI BEACH"? Date: Mon, 07 Jan 2019 14:33:03 +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 On Nov 20 2018, Atish Patra wrote: > diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c > index 18cda0e8..fc185eca 100644 > --- a/arch/riscv/kernel/smpboot.c > +++ b/arch/riscv/kernel/smpboot.c > @@ -57,12 +57,15 @@ void __init setup_smp(void) > > while ((dn = of_find_node_by_type(dn, "cpu"))) { > hart = riscv_of_processor_hartid(dn); > - if (hart < 0) > + if (hart < 0) { > + of_node_put(dn); > continue; > + } > > if (hart == cpuid_to_hartid_map(0)) { > BUG_ON(found_boot_cpu); > found_boot_cpu = 1; > + of_node_put(dn); > continue; > } > [ 0.000000] OF: ERROR: Bad of_node_put() on /cpus/cpu@0 [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.0.0-rc1-00013-ge0b3e41110 #4 [ 0.000000] Call Trace: [ 0.000000] [] walk_stackframe+0x0/0xa4 [ 0.000000] [] show_stack+0x2a/0x34 [ 0.000000] [] dump_stack+0x62/0x7c [ 0.000000] [] of_node_release+0xbe/0xc0 [ 0.000000] [] kobject_put+0xa6/0x1e8 [ 0.000000] [] of_node_put+0x16/0x20 [ 0.000000] [] of_find_node_by_type+0x66/0xa4 [ 0.000000] [] 0xffffffe0000028bc [ 0.000000] [] 0xffffffe0000026cc [ 0.000000] [] 0xffffffe0000006ec [ 0.000000] [] 0xffffffe000000076 [ 0.000000] OF: ERROR: Bad of_node_put() on /cpus/cpu@1 [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 5.0.0-rc1-00013-ge0b3e41110 #4 [ 0.000000] Call Trace: [ 0.000000] [] walk_stackframe+0x0/0xa4 [ 0.000000] [] show_stack+0x2a/0x34 [ 0.000000] [] dump_stack+0x62/0x7c [ 0.000000] [] of_node_release+0xbe/0xc0 [ 0.000000] [] kobject_put+0xa6/0x1e8 [ 0.000000] [] of_node_put+0x16/0x20 [ 0.000000] [] of_find_node_by_type+0x66/0xa4 [ 0.000000] [] 0xffffffe0000028bc [ 0.000000] [] 0xffffffe0000026cc [ 0.000000] [] 0xffffffe0000006ec [ 0.000000] [] 0xffffffe000000076 Andreas. -- 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."