From: Bradley Morgan <bradley.morgan@linux.dev>
To: Tom Rini <trini@konsulko.com>, Bradley Morgan <bradley.morgan@linux.dev>
Cc: u-boot@lists.u-boot-project.org, Christophe Leroy <cleroy@kernel.org>
Subject: [PATCH] powerpc: bootm: propagate cmdline and bd_t allocation failures
Date: Wed, 2 Dec 2026 19:31:01 +0000 [thread overview]
Message-ID: <20261202193101.353433-1-bradley.morgan@linux.dev> (raw)
do_bootm_linux() ignores the return value from boot_cmdline_linux()
and boot_bd_t_linux(). If either allocation fails, bootm still jumps
to the kernel with a NULL command line or board info pointer, which
turns a clean allocation failure into a kernel fault with no useful
diagnostic.
Return the error to bootm instead.
Signed-off-by: Bradley Morgan <bradley.morgan@linux.dev>
---
arch/powerpc/lib/bootm.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c
index 9b0ce9c4b81..5c3f5fb805c 100644
--- a/arch/powerpc/lib/bootm.c
+++ b/arch/powerpc/lib/bootm.c
@@ -179,15 +179,11 @@ int do_bootm_linux(int flag, struct bootm_info *bmi)
struct bootm_headers *images = bmi->images;
int ret;
- if (flag & BOOTM_STATE_OS_CMDLINE) {
- boot_cmdline_linux(images);
- return 0;
- }
+ if (flag & BOOTM_STATE_OS_CMDLINE)
+ return boot_cmdline_linux(images);
- if (flag & BOOTM_STATE_OS_BD_T) {
- boot_bd_t_linux(images);
- return 0;
- }
+ if (flag & BOOTM_STATE_OS_BD_T)
+ return boot_bd_t_linux(images);
if (flag & BOOTM_STATE_OS_PREP) {
boot_prep_linux(images);
reply other threads:[~2026-12-02 19:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261202193101.353433-1-bradley.morgan@linux.dev \
--to=bradley.morgan@linux.dev \
--cc=cleroy@kernel.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
/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