diff options
author | Simon Glass <sjg@chromium.org> | 2020-03-02 12:02:54 -0700 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-12-14 16:00:43 +0100 |
commit | fe0b99d3eb31cbc64289cb5d9b48c85075bf8f4a (patch) | |
tree | 2e18f66d0cfc34b57c408b0fe1cfdda3432bf389 /cpukit/dtc/libfdt/fdt_ro.c | |
parent | libfdt: Improve comments in some of the assumptions (diff) | |
download | rtems-fe0b99d3eb31cbc64289cb5d9b48c85075bf8f4a.tar.bz2 |
libfdt: Add support for disabling internal checks
If libfdt returns -FDT_ERR_INTERNAL that generally indicates a bug in the
library. Add a new assumption for these cases since it should be save to
disable these checks regardless of the input.
Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20200302190255.51426-3-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to '')
-rw-r--r-- | cpukit/dtc/libfdt/fdt_ro.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cpukit/dtc/libfdt/fdt_ro.c b/cpukit/dtc/libfdt/fdt_ro.c index 194550344a..e03570a56e 100644 --- a/cpukit/dtc/libfdt/fdt_ro.c +++ b/cpukit/dtc/libfdt/fdt_ro.c @@ -402,7 +402,7 @@ static const struct fdt_property *fdt_get_property_namelen_(const void *fdt, const struct fdt_property *prop; prop = fdt_get_property_by_offset_(fdt, offset, lenp); - if (!can_assume(VALID_DTB) && !prop) { + if (!can_assume(LIBFDT_FLAWLESS) && !prop) { offset = -FDT_ERR_INTERNAL; break; } @@ -634,7 +634,7 @@ int fdt_node_depth(const void *fdt, int nodeoffset) err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth); if (err) - return (can_assume(VALID_INPUT) || err < 0) ? err : + return (can_assume(LIBFDT_FLAWLESS) || err < 0) ? err : -FDT_ERR_INTERNAL; return nodedepth; } |