aboutsummaryrefslogtreecommitdiff
path: root/lib/libfdt
diff options
context:
space:
mode:
authorMasahiro Yamada2016-10-17 20:22:33 +0900
committerTom Rini2016-10-24 08:04:39 -0400
commit7c9786d61f951dd8d031e88e198e0ae88b8da2b3 (patch)
tree1b788ddb8117a882da535c66e479e78457a5179c /lib/libfdt
parent28a3a43d7be74000a0d480f6f32e31c5ff22d4bc (diff)
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 7e894b742b4..fc08981a2c8 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;