diff options
author | Stefan Agner <stefan@agner.ch> | 2016-12-14 20:59:17 -0800 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2017-01-11 21:27:14 +0100 |
commit | 9c92ffd2888c79134ef418b38978c7f50fdb7bbf (patch) | |
tree | 213295a7413c84b16e3510bf6fdd4fa168f95661 /lib | |
parent | bfd9584e76690d7a54752067475411a8f9c248a0 (diff) |
libfdt: overlay: Fix missing symbols condition
When there is no symbols section in the device tree,
overlay_fixup_phandles should return FDT_ERR_NOTFOUND instead of
FDT_ERR_BADOFFSET.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libfdt/fdt_overlay.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libfdt/fdt_overlay.c b/lib/libfdt/fdt_overlay.c index bb414041297..4a9ba400252 100644 --- a/lib/libfdt/fdt_overlay.c +++ b/lib/libfdt/fdt_overlay.c @@ -495,9 +495,9 @@ static int overlay_fixup_phandles(void *fdt, void *fdto) if ((fixups_off < 0 && (fixups_off != -FDT_ERR_NOTFOUND))) return fixups_off; - /* And base DTs without symbols */ + /* But if we need to fixup phandles, symbols are required */ symbols_off = fdt_path_offset(fdt, "/__symbols__"); - if ((symbols_off < 0 && (symbols_off != -FDT_ERR_NOTFOUND))) + if (symbols_off < 0) return symbols_off; fdt_for_each_property_offset(property, fdto, fixups_off) { |