summaryrefslogtreecommitdiff
path: root/libfdt/fdt_ro.c
diff options
context:
space:
mode:
Diffstat (limited to 'libfdt/fdt_ro.c')
-rw-r--r--libfdt/fdt_ro.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 923c389..ffd9209 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -283,6 +283,10 @@ int fdt_find_node_by_path(const void *fdt, const char *path)
if (*path != '/')
return -FDT_ERR_BADPATH;
+ /* Handle the root path: root offset is 0 */
+ if (strcmp(path, "/") == 0)
+ return 0;
+
while (*p) {
const char *q;