diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c index dc4a596..65bd1a2 100644 --- a/libfdt/fdt_ro.c +++ b/libfdt/fdt_ro.c @@ -302,7 +302,7 @@ int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen) buf[0] = '/'; p = 1; - while (offset < nodeoffset) { + while (nextoffset <= nodeoffset) { offset = nextoffset; tag = _fdt_next_tag(fdt, offset, &nextoffset); switch (tag) {