* [PATCH] powerpc: bootm: propagate cmdline and bd_t allocation failures
@ 2026-12-02 19:31 Bradley Morgan
0 siblings, 0 replies; only message in thread
From: Bradley Morgan @ 2026-12-02 19:31 UTC (permalink / raw)
To: Tom Rini, Bradley Morgan; +Cc: u-boot, Christophe Leroy
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);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-02 19:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 19:31 [PATCH] powerpc: bootm: propagate cmdline and bd_t allocation failures Bradley Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox