From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: Rob Herring <robh@kernel.org>,
Saravana Kannan <saravanak@kernel.org>,
Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: devicetree@vger.kernel.org, loongarch@lists.linux.dev,
linux-mips@vger.kernel.org,
Sang-Heon Jeon <ekffu200098@gmail.com>
Subject: [PATCH 3/3] MIPS: fix misleading elfcorehdr reservation success message
Date: Mon, 15 Jun 2026 01:15:03 +0900 [thread overview]
Message-ID: <20260614161503.2219681-4-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260614161503.2219681-1-ekffu200098@gmail.com>
mips_reserve_vmcore() does not check the return value of
memblock_reserve(), so a success message is falsely printed when the
reservation fails.
Reserve before printing the success message. Check the return value and
warn on failure instead.
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
arch/mips/kernel/setup.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 1ae6d0c0e1d6..c7769ed882e8 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -437,10 +437,13 @@ static void __init mips_reserve_vmcore(void)
}
}
+ if (memblock_reserve(elfcorehdr_addr, elfcorehdr_size)) {
+ pr_warn("Failed to reserve memory for kdump\n");
+ return;
+ }
+
pr_info("Reserving %ldKB of memory at %ldKB for kdump\n",
(unsigned long)elfcorehdr_size >> 10, (unsigned long)elfcorehdr_addr >> 10);
-
- memblock_reserve(elfcorehdr_addr, elfcorehdr_size);
#endif
}
--
2.43.0
prev parent reply other threads:[~2026-06-14 16:15 UTC|newest]
Thread overview: 6+ 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
2026-06-16 18:13 ` Sang-Heon Jeon
2026-06-14 16:15 ` [PATCH 2/3] LoongArch: " Sang-Heon Jeon
2026-06-14 16:15 ` Sang-Heon Jeon [this message]
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=20260614161503.2219681-4-ekffu200098@gmail.com \
--to=ekffu200098@gmail.com \
--cc=chenhuacai@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-mips@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=robh@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.