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

Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---

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

diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c
index fc08981..1be9538 100644
--- a/lib/libfdt/fdt_ro.c
+++ b/lib/libfdt/fdt_ro.c
@@ -576,7 +576,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;
-- 
1.9.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to