]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - tools/dtoc/fdt.py
dtoc: Fix Fdt.GetNode() to handle a missing node
[thirdparty/u-boot.git] / tools / dtoc / fdt.py
index 274c142e7ae55fab88b92896fba6ab92c12adc35..c1d04d48e889699159e38576d76c53db75fe2b93 100644 (file)
@@ -318,7 +318,10 @@ class Fdt:
             Node object, or None if not found
         """
         node = self._root
-        for part in path.split('/')[1:]:
+        parts = path.split('/')
+        if len(parts) < 2:
+            return None
+        for part in parts[1:]:
             node = node._FindNode(part)
             if not node:
                 return None