summaryrefslogtreecommitdiffstats
path: root/cpukit/dtc/libfdt/fdt_ro.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-10-17 15:08:23 +0900
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-07-19 07:01:10 +0200
commitaa9389f44d442bb0b18434ab522df83551f71cef (patch)
tree4964236daf2372c51a2fb0b42ac63a278bee9091 /cpukit/dtc/libfdt/fdt_ro.c
parentfdt: strerr: Remove spurious BADOVERLAY (diff)
downloadrtems-aa9389f44d442bb0b18434ab522df83551f71cef.tar.bz2
libfdt: fix fdt_stringlist_count()
If fdt_getprop() fails, negative error code should be returned. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'cpukit/dtc/libfdt/fdt_ro.c')
-rw-r--r--cpukit/dtc/libfdt/fdt_ro.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cpukit/dtc/libfdt/fdt_ro.c b/cpukit/dtc/libfdt/fdt_ro.c
index 04590984bd..db8d10fcd4 100644
--- a/cpukit/dtc/libfdt/fdt_ro.c
+++ b/cpukit/dtc/libfdt/fdt_ro.c
@@ -571,7 +571,7 @@ int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property)
list = fdt_getprop(fdt, nodeoffset, property, &length);
if (!list)
- return -length;
+ return length;
end = list + length;