From 8a07eb223e5795a19ef421b177b703b99a1d5fe4 Mon Sep 17 00:00:00 2001 From: Sanjeev N Date: Fri, 20 Jul 2018 16:24:48 +0530 Subject: [PATCH] fdt_fixup: initialize nodeoff before setting property Nodeoff must be initialized to ensure root node is present. Change-Id: I1091a816f5b92c3f798222da9c987d899ef4bc9f Signed-off-by: Sanjeev N --- board/qca/arm/ipq806x/ipq806x.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/board/qca/arm/ipq806x/ipq806x.c b/board/qca/arm/ipq806x/ipq806x.c index 6e583ad4a4..7af5148f65 100644 --- a/board/qca/arm/ipq806x/ipq806x.c +++ b/board/qca/arm/ipq806x/ipq806x.c @@ -535,6 +535,13 @@ void ipq_fdt_fixup_socinfo(void *blob) uint32_t soc_version, soc_version_major, soc_version_minor; int nodeoff, ret; + nodeoff = fdt_path_offset(blob, "/"); + + if (nodeoff < 0) { + printf("ipq: fdt fixup cannot find root node\n"); + return; + } + ret = ipq_smem_get_socinfo_cpu_type(&cpu_type); if (ret) { return;