stand/fdt: Avoid bailout when dtbo has no fixups

In the case of a simple dtbo where fragment uses target-path and the overlay
contains no references, /__fixups__ will not be included by either our dtc
or dtc from ports, but the file still has valid fragments to be applied.

Additional testing found that /__symbols__ might also be omitted if it's
empty, which is not necessarily an error.

Reviewed by:	gonzo, imp
Differential Revision:	https://reviews.freebsd.org/D13663
This commit is contained in:
Kyle Evans 2017-12-28 21:12:27 +00:00
parent a609d03b04
commit 5c0700f692

View File

@ -324,10 +324,16 @@ fdt_overlay_do_fixups(void *main_fdtp, void *overlay_fdtp)
main_symbols_o = fdt_path_offset(main_fdtp, "/__symbols__");
overlay_fixups_o = fdt_path_offset(overlay_fdtp, "/__fixups__");
if (main_symbols_o < 0)
if (main_symbols_o < 0) {
if (main_symbols_o == -FDT_ERR_NOTFOUND)
return (0);
return (-1);
if (overlay_fixups_o < 0)
}
if (overlay_fixups_o < 0) {
if (overlay_fixups_o == -FDT_ERR_NOTFOUND)
return (0);
return (-1);
}
for (fixup_prop_o = fdt_first_property_offset(overlay_fdtp, overlay_fixups_o);
fixup_prop_o >= 0;