All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/boot: Restore /chosen error check in of_console_open()
@ 2026-12-01 12:52 Thorsten Blum
  0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-12-01 12:52 UTC (permalink / raw)
  To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Ritesh Harjani (IBM),
	Shrikanth Hegde, Mark A. Greer, Paul Mackerras
  Cc: Thorsten Blum, linuxppc-dev

Before the boot wrapper reorganization, the code checked if finddevice()
returned (void *)-1. The reorganization replaced that check with a NULL
check. Restore the (void *)-1 check so a failed lookup does not pass an
invalid handle to of_getprop().

Fixes: b2c5f61920ee ("[POWERPC] Start arch/powerpc/boot code reorganization")
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 arch/powerpc/boot/ofconsole.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/boot/ofconsole.c b/arch/powerpc/boot/ofconsole.c
index 8eb0f1c452c5..6dbb0e46ed02 100644
--- a/arch/powerpc/boot/ofconsole.c
+++ b/arch/powerpc/boot/ofconsole.c
@@ -21,6 +21,7 @@ static int of_console_open(void)
 	void *devp;
 
 	if (((devp = of_finddevice("/chosen")) != NULL)
+	    && (devp != (void *)-1)
 	    && (of_getprop(devp, "stdout", &of_stdout_handle,
 			   sizeof(of_stdout_handle))
 		== sizeof(of_stdout_handle))) {


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-01 12:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 12:52 [PATCH] powerpc/boot: Restore /chosen error check in of_console_open() Thorsten Blum

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.