Linux-RISC-V Archive on lore.kernel.org
 help / color / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Atish Patra <atish.patra@wdc.com>
Cc: anup@brainfault.org, palmer@sifive.com,
	linux-kernel@vger.kernel.org, jeremy.linton@arm.com,
	sudeep.holla@arm.com, linux-riscv@lists.infradead.org
Subject: Re: [PATCH] RISC-V: Fix of_node_* refcount
Date: Mon, 07 Jan 2019 14:33:03 +0100
Message-ID: <mvmd0p8wq28.fsf@suse.de> (raw)
In-Reply-To: <1542755270-10433-1-git-send-email-atish.patra@wdc.com>

On Nov 20 2018, Atish Patra <atish.patra@wdc.com> 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] [<ffffffe0010c8c74>] walk_stackframe+0x0/0xa4
[    0.000000] [<ffffffe0010c8e74>] show_stack+0x2a/0x34
[    0.000000] [<ffffffe00160989c>] dump_stack+0x62/0x7c
[    0.000000] [<ffffffe0014d9660>] of_node_release+0xbe/0xc0
[    0.000000] [<ffffffe00160e560>] kobject_put+0xa6/0x1e8
[    0.000000] [<ffffffe0014d8bb8>] of_node_put+0x16/0x20
[    0.000000] [<ffffffe0014d4bc2>] of_find_node_by_type+0x66/0xa4
[    0.000000] [<ffffffe0000028bc>] 0xffffffe0000028bc
[    0.000000] [<ffffffe0000026cc>] 0xffffffe0000026cc
[    0.000000] [<ffffffe0000006ec>] 0xffffffe0000006ec
[    0.000000] [<ffffffe000000076>] 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] [<ffffffe0010c8c74>] walk_stackframe+0x0/0xa4
[    0.000000] [<ffffffe0010c8e74>] show_stack+0x2a/0x34
[    0.000000] [<ffffffe00160989c>] dump_stack+0x62/0x7c
[    0.000000] [<ffffffe0014d9660>] of_node_release+0xbe/0xc0
[    0.000000] [<ffffffe00160e560>] kobject_put+0xa6/0x1e8
[    0.000000] [<ffffffe0014d8bb8>] of_node_put+0x16/0x20
[    0.000000] [<ffffffe0014d4bc2>] of_find_node_by_type+0x66/0xa4
[    0.000000] [<ffffffe0000028bc>] 0xffffffe0000028bc
[    0.000000] [<ffffffe0000026cc>] 0xffffffe0000026cc
[    0.000000] [<ffffffe0000006ec>] 0xffffffe0000006ec
[    0.000000] [<ffffffe000000076>] 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."

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 23:07 atish.patra
2018-11-20 23:07 ` Atish Patra
2018-12-18 23:55 ` Atish Patra
2019-01-07 13:33 ` Andreas Schwab [this message]
2019-01-07 14:16 ` [PATCH] RISC-V: fix bad use of of_node_put Andreas Schwab
2019-01-08 10:10   ` Atish Patra

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mvmd0p8wq28.fsf@suse.de \
    --to=schwab@suse.de \
    --cc=anup@brainfault.org \
    --cc=atish.patra@wdc.com \
    --cc=jeremy.linton@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@sifive.com \
    --cc=sudeep.holla@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-RISC-V Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-riscv/0 linux-riscv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-riscv linux-riscv/ https://lore.kernel.org/linux-riscv \
		linux-riscv@lists.infradead.org infradead-linux-riscv@archiver.kernel.org
	public-inbox-index linux-riscv


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-riscv


AGPL code for this site: git clone https://public-inbox.org/ public-inbox