cpukit/rtems-fdt: return offset 0 for the root node

Fixes #5612
This commit is contained in:
Gedare Bloom
2026-06-11 17:25:15 -05:00
committed by Joel Sherrill
parent fc29c5d1e8
commit 9aa0c138b6
+4
View File
@@ -254,6 +254,10 @@ static int rtems_fdt_index_find_by_name(
size_t namelen = strlen( name );
if ( namelen > 0 && name[ namelen - 1 ] == '/' ) {
namelen--;
/* handle the root node */
if ( namelen == 0 ) {
return 0;
}
}
/* Binary search for the name. */