]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
powerpc/boot: Fix treeboot-currituck CPU node lookup check
authorThorsten Blum <thorsten.blum@linux.dev>
Thu, 2 Jul 2026 21:15:56 +0000 (23:15 +0200)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Tue, 28 Jul 2026 04:53:31 +0000 (10:23 +0530)
fdt_node_offset_by_prop_value() returns a negative error code on
failure - fix the check accordingly.

Fixes: 228d55053397 ("powerpc/47x: Add support for the new IBM currituck platform")
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-5-thorsten.blum@linux.dev
arch/powerpc/boot/treeboot-currituck.c

index d53e8a592f816edcd42e0bc9f7d605c8ff75a48f..5b5363b74f9f3670fbc79d9f6e0148694e490f01 100644 (file)
@@ -102,7 +102,7 @@ void platform_init(void)
 
        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))