libfdt: fix fdt_stringlist_count()

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

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 15:08:23 +09:00 committed by David Gibson
parent ae97c77228
commit e28eff5b78

View file

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