Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Sang-Heon Jeon <ekffu200098@gmail.com>
Cc: Saravana Kannan <saravanak@kernel.org>,
	Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	devicetree@vger.kernel.org, loongarch@lists.linux.dev,
	linux-mips@vger.kernel.org
Subject: Re: [PATCH 1/3] of/fdt: fix misleading elfcorehdr reservation success message
Date: Tue, 16 Jun 2026 08:19:45 -0500	[thread overview]
Message-ID: <20260616131945.GA2236977-robh@kernel.org> (raw)
In-Reply-To: <20260614161503.2219681-2-ekffu200098@gmail.com>

On Mon, Jun 15, 2026 at 01:15:01AM +0900, Sang-Heon Jeon wrote:
> fdt_reserve_elfcorehdr() does not check the return value of
> memblock_reserve(), so a success message is falsely printed when the
> reservation fails.
> 
> Check the return value and warn on failure instead.
> 
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
> ---
>  drivers/of/fdt.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index 26f66046cc32..d985c07d7c5c 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -479,7 +479,10 @@ static void __init fdt_reserve_elfcorehdr(void)
>  		return;
>  	}
>  
> -	memblock_reserve(elfcorehdr_addr, elfcorehdr_size);
> +	if (memblock_reserve(elfcorehdr_addr, elfcorehdr_size)) {
> +		pr_warn("Failed to reserve memory for elfcorehdr\n");

I would think memblock_reserve() should always succeed and if not it 
should print a message rather than having every caller print a message.

Rob

  reply	other threads:[~2026-06-16 13:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-14 16:15 [PATCH 0/3] of/fdt, LoongArch, MIPS: fix misleading reservation success message Sang-Heon Jeon
2026-06-14 16:15 ` [PATCH 1/3] of/fdt: fix misleading elfcorehdr " Sang-Heon Jeon
2026-06-16 13:19   ` Rob Herring [this message]
2026-06-14 16:15 ` [PATCH 2/3] LoongArch: " Sang-Heon Jeon
2026-06-14 16:15 ` [PATCH 3/3] MIPS: " Sang-Heon Jeon

Reply instructions:

You may reply publicly 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=20260616131945.GA2236977-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ekffu200098@gmail.com \
    --cc=kernel@xen0n.name \
    --cc=linux-mips@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=saravanak@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox