summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2026-07-02 23:15:55 +0200
committerMadhavan Srinivasan <maddy@linux.ibm.com>2026-07-28 10:23:31 +0530
commitc824ab65685bb119c6c6a3a200b3428c72862d5a (patch)
tree225f0c13c7d04651331120ee9751edf45766a8bb
parent263e5159e00aa46bf26f3496ff7aae1fc9a6c826 (diff)
powerpc/boot: Fix simpleboot CPU node lookup check
fdt_node_offset_by_prop_value() returns a negative error code on failure - fix the check accordingly. Fixes: d2477b5cc8ca ("[POWERPC] bootwrapper: Add a firmware-independent simpleboot target.") Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260702211554.56923-4-thorsten.blum@linux.dev
-rw-r--r--arch/powerpc/boot/simpleboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/boot/simpleboot.c b/arch/powerpc/boot/simpleboot.c
index c80691d83880..27591df41e9e 100644
--- a/arch/powerpc/boot/simpleboot.c
+++ b/arch/powerpc/boot/simpleboot.c
@@ -68,7 +68,7 @@ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
/* finally, setup the timebase */
node = fdt_node_offset_by_prop_value(_dtb_start, -1, "device_type",
"cpu", sizeof("cpu"));
- if (!node)
+ if (node < 0)
fatal("Cannot find cpu node\n");
timebase = fdt_getprop(_dtb_start, node, "timebase-frequency", &size);
if (timebase && (size == 4))