[rtems commit] libfdt: fix fdt_stringlist_search()
Sebastian Huber
sebh at rtems.org
Thu Jul 19 05:07:41 UTC 2018
Module: rtems
Branch: master
Commit: d8c856bd3fd69dbda558d1c71b0cdcc5c0a367ad
Changeset: http://git.rtems.org/rtems/commit/?id=d8c856bd3fd69dbda558d1c71b0cdcc5c0a367ad
Author: Masahiro Yamada <yamada.masahiro at socionext.com>
Date: Mon Oct 17 15:08:24 2016 +0900
libfdt: fix fdt_stringlist_search()
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 db8d10f..3d00d2e 100644
--- a/cpukit/dtc/libfdt/fdt_ro.c
+++ b/cpukit/dtc/libfdt/fdt_ro.c
@@ -597,7 +597,7 @@ int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
list = fdt_getprop(fdt, nodeoffset, property, &length);
if (!list)
- return -length;
+ return length;
len = strlen(string) + 1;
end = list + length;
More information about the vc
mailing list