diff mbox

[v2,1/2] libfdt: fix fdt_stringlist_count()

Message ID 1476703354-16474-2-git-send-email-yamada.masahiro@socionext.com
State New
Headers show

Commit Message

Masahiro Yamada Oct. 17, 2016, 11:22 a.m. UTC
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>

---

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

-- 
1.9.1

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

Comments

Tom Rini Oct. 24, 2016, 3:24 p.m. UTC | #1
On Mon, Oct 17, 2016 at 08:22:33PM +0900, Masahiro Yamada wrote:

> 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>


Applied to u-boot/master, thanks!

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

Patch

diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c
index 7e894b7..fc08981 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;