aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2016-10-06 13:39:57 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2016-10-07 12:28:58 +1100
commitcabbaa972cddb193dbe170f3797825a5d4ca66fa (patch)
tree1d29553ace5a83695e068040e61c230e26099d5a
parentdeb0a5c1aeaa34130305d765251bbb76e888f4e7 (diff)
downloaddtc-cabbaa972cddb193dbe170f3797825a5d4ca66fa.zip
dtc-cabbaa972cddb193dbe170f3797825a5d4ca66fa.tar.gz
dtc-cabbaa972cddb193dbe170f3797825a5d4ca66fa.tar.bz2
libfdt: overlay: Report a bad overlay for mismatching local fixups
The __local_fixups__ node as a structure that mimics the structure of the main overlay part. This means that if we have a child node somewhere in the local fixups sub-tree and if that node is not present in the main tree, the overlay is poorly formatted, and we should report it as such. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--libfdt/fdt_overlay.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libfdt/fdt_overlay.c b/libfdt/fdt_overlay.c
index 322e7ad..2f306e4 100644
--- a/libfdt/fdt_overlay.c
+++ b/libfdt/fdt_overlay.c
@@ -272,6 +272,8 @@ static int overlay_update_local_node_references(void *fdto,
tree_child = fdt_subnode_offset(fdto, tree_node,
fixup_child_name);
+ if (ret == -FDT_ERR_NOTFOUND)
+ return -FDT_ERR_BADOVERLAY;
if (tree_child < 0)
return tree_child;