libfdt: fix fdt_stringlist_count()

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>
This commit is contained in:
Masahiro Yamada 2016-10-17 20:22:33 +09:00 committed by Tom Rini
parent 28a3a43d7b
commit 7c9786d61f
1 changed files with 1 additions and 1 deletions

View File

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