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:
committed by
David Gibson
parent
ae97c77228
commit
e28eff5b78
@@ -571,7 +571,7 @@ int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property)
|
|||||||
|
|
||||||
list = fdt_getprop(fdt, nodeoffset, property, &length);
|
list = fdt_getprop(fdt, nodeoffset, property, &length);
|
||||||
if (!list)
|
if (!list)
|
||||||
return -length;
|
return length;
|
||||||
|
|
||||||
end = list + length;
|
end = list + length;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user