summaryrefslogtreecommitdiff
path: root/lib/libfdt
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-10-17 20:22:33 +0900
committerTom Rini <trini@konsulko.com>2016-10-24 08:04:39 -0400
commit7c9786d61f951dd8d031e88e198e0ae88b8da2b3 (patch)
tree1b788ddb8117a882da535c66e479e78457a5179c /lib/libfdt
parent28a3a43d7be74000a0d480f6f32e31c5ff22d4bc (diff)
downloadu-boot-imx-7c9786d61f951dd8d031e88e198e0ae88b8da2b3.zip
u-boot-imx-7c9786d61f951dd8d031e88e198e0ae88b8da2b3.tar.gz
u-boot-imx-7c9786d61f951dd8d031e88e198e0ae88b8da2b3.tar.bz2
libfdt: fix fdt_stringlist_count()
If fdt_getprop() fails, negative error code should be returned. [ DTC commit: e28eff5b787adb3f461d1653598818b2f1f25a73 ] Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'lib/libfdt')
-rw-r--r--lib/libfdt/fdt_ro.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c
index 7e894b7..fc08981 100644
--- a/lib/libfdt/fdt_ro.c
+++ b/lib/libfdt/fdt_ro.c
@@ -550,7 +550,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;