From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 343723F9FB for ; Thu, 2 Jul 2026 21:17:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783027032; cv=none; b=qOnSgZEK/Zuu2ppWICl2a0/3D9H0pgA15CdQhQEDVXD3su1yB39VGrnubIqHX9+rpqTDK0Oh/n00fiedEEOIBjxpoZn03ezjqNrS86uco6DLbWbFk8aaW02YwNq4pxs5/Bi86tvSHalgyfdWWYvEdUApkxZQZ/dKgnT+X5/BlyY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783027032; c=relaxed/simple; bh=a8z9ZcVrkiRPripAUUepnLp9TG1kSmUTU/ZeAF7JaQo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MFHB7fx69ADnf73isg51ihGGEoBlgr2jFtLv44RVKqDsX/xtnM9Mvsy1U+2yYlk+o+FArLNonr3FIdvkcljZ7V6yekzwjaWepix/QdXeLr6kfxwaWG/yV2Gd23AoG6VbccQkn0XwTMFdXAdq2S9+cJSJ/kgwVXfBeDjk2PhZu4g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=AlIFqVjd; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="AlIFqVjd" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1783027027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=FckzSume9UAhWiCYjPeKT36jEriGGdovDEyFKM1FYdU=; b=AlIFqVjdi8/mjO2vbbk5RfrR9z5ae9BqLW1E0RUz4RVsbtCdj72M8UK4Bno3NYac0Q/+CJ vQYAnKxH7BI3T31Yy/r1KiCfapk+Yk/Kp4Gh6auE3Ar3eBEJdK1k7BaqLu050lyd9wJROt vv/Uj2nN2fWbgX+uQYRElKJhDZDCqy8= From: Thorsten Blum To: Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Josh Boyer , Grant Likely , Tony Breeds , Alistair Popple , Benjamin Herrenschmidt Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Thorsten Blum Subject: [PATCH 1/3] powerpc/boot: Fix simpleboot CPU node lookup check Date: Thu, 2 Jul 2026 23:15:55 +0200 Message-ID: <20260702211554.56923-4-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=955; i=thorsten.blum@linux.dev; h=from:subject; bh=a8z9ZcVrkiRPripAUUepnLp9TG1kSmUTU/ZeAF7JaQo=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFluV7kMfNzcjKVEd2Rw3VnTv07WXyFdW4trYWXyprgfX dbShcs6SlkYxLgYZMUUWR7M+jHDt7SmcpNJxE6YOaxMIEMYuDgFYCJznBgZJl12/Hy0je9q0hXu 7xVm/Gs4+6f3Lma5oq14XD5tasT9uYwMy5vZX/odSfopnnQlf/cWHunvU9/N01+9VV323mvL+It 7uAE= X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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 --- arch/powerpc/boot/simpleboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))