[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260210173349.636766-8-herve.codina@bootlin.com>
Date: Tue, 10 Feb 2026 18:33:35 +0100
From: Herve Codina <herve.codina@...tlin.com>
To: David Gibson <david@...son.dropbear.id.au>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Conor Dooley <conor+dt@...nel.org>
Cc: Ayush Singh <ayush@...gleboard.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
devicetree-compiler@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
devicetree-spec@...r.kernel.org,
Hui Pu <hui.pu@...ealthcare.com>,
Ian Ray <ian.ray@...ealthcare.com>,
Luca Ceresoli <luca.ceresoli@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Herve Codina <herve.codina@...tlin.com>
Subject: [RFC PATCH 07/15] libfdt: fdt_check_full: Handle FDT_NOP when FDT_END is expected
fdt_check_full() makes the assumption that a FDT_END tag is present
immediately after the FDT_END_NODE tag related to the root node.
This assumption is not correct. Indeed, FDT_NOP tags can be present
between this FDT_END_NODE tag and the FDT_END tag.
Handle those possible FDT_NOP tags.
Signed-off-by: Herve Codina <herve.codina@...tlin.com>
---
libfdt/fdt_check.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libfdt/fdt_check.c b/libfdt/fdt_check.c
index a21ebbc..cca0523 100644
--- a/libfdt/fdt_check.c
+++ b/libfdt/fdt_check.c
@@ -43,7 +43,7 @@ int fdt_check_full(const void *fdt, size_t bufsize)
return nextoffset;
/* If we see two root nodes, something is wrong */
- if (expect_end && tag != FDT_END)
+ if (expect_end && tag != FDT_END && tag != FDT_NOP)
return -FDT_ERR_BADSTRUCTURE;
switch (tag) {
--
2.52.0
Powered by blists - more mailing lists