Browse Source

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>
main
Masahiro Yamada 8 years ago committed by David Gibson
parent
commit
e28eff5b78
  1. 2
      libfdt/fdt_ro.c

2
libfdt/fdt_ro.c

@ -571,7 +571,7 @@ int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property) @@ -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;


Loading…
Cancel
Save