From: Masahiro Yamada Date: Mon, 17 Oct 2016 11:22:33 +0000 (+0900) Subject: libfdt: fix fdt_stringlist_count() X-Git-Tag: v2016.11-rc3~49 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7c9786d61f951dd8d031e88e198e0ae88b8da2b3;p=u-boot libfdt: fix fdt_stringlist_count() If fdt_getprop() fails, negative error code should be returned. [ DTC commit: e28eff5b787adb3f461d1653598818b2f1f25a73 ] Signed-off-by: Masahiro Yamada Signed-off-by: David Gibson --- diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c index 7e894b742b..fc08981a2c 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;