[rtems commit] libfdt: fix fdt_stringlist_count()

Sebastian Huber sebh at rtems.org
Thu Jul 19 05:07:41 UTC 2018


Module:    rtems
Branch:    master
Commit:    aa9389f44d442bb0b18434ab522df83551f71cef
Changeset: http://git.rtems.org/rtems/commit/?id=aa9389f44d442bb0b18434ab522df83551f71cef

Author:    Masahiro Yamada <yamada.masahiro at socionext.com>
Date:      Mon Oct 17 15:08:23 2016 +0900

libfdt: fix fdt_stringlist_count()

If fdt_getprop() fails, negative error code should be returned.

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
Signed-off-by: David Gibson <david at gibson.dropbear.id.au>

---

 cpukit/dtc/libfdt/fdt_ro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/dtc/libfdt/fdt_ro.c b/cpukit/dtc/libfdt/fdt_ro.c
index 0459098..db8d10f 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;
 



More information about the vc mailing list