mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
fdtdec: Allow using fdtdec_get_carveout() in loops
In order make it possible to use fdtdec_get_carveout() in loops, return FDT_ERR_NOTFOUND when the passed-in index exceeds the number of phandles present in the given property. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
This commit is contained in:
parent
10cd8efe1a
commit
d5598cfa9b
1 changed files with 1 additions and 1 deletions
|
@ -1431,7 +1431,7 @@ int fdtdec_get_carveout(const void *blob, const char *node, const char *name,
|
|||
|
||||
if (len < (sizeof(phandle) * (index + 1))) {
|
||||
debug("invalid phandle index\n");
|
||||
return -FDT_ERR_BADPHANDLE;
|
||||
return -FDT_ERR_NOTFOUND;
|
||||
}
|
||||
|
||||
phandle = fdt32_to_cpu(prop[index]);
|
||||
|
|
Loading…
Reference in a new issue