[U-Boot] [PATCH v2 0/2] libfdt: fix "Bring in upstream stringlist functions"

I found my boards are broken since
commit b02e4044ff8ee1f6ac83917a39514172a9b449fb Author: Simon Glass sjg@chromium.org Date: Sun Oct 2 17:59:28 2016 -0600
libfdt: Bring in upstream stringlist functions
I figured out that the root cause is in the upstream libfdt.
The upstream libfdt has been fixed, so I am backporting commits.
Changes in v2: - Add sob of David Gibson
Masahiro Yamada (2): libfdt: fix fdt_stringlist_count() libfdt: fix fdt_stringlist_search()
lib/libfdt/fdt_ro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

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(-)
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;

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!

If fdt_getprop() fails, negative error code should be returned.
[ DTC commit: daa75e8fa5942caa8e97931aed3a1ee0b7edd74b ]
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(-)
diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c index fc08981..1be9538 100644 --- a/lib/libfdt/fdt_ro.c +++ b/lib/libfdt/fdt_ro.c @@ -576,7 +576,7 @@ int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
list = fdt_getprop(fdt, nodeoffset, property, &length); if (!list) - return -length; + return length;
len = strlen(string) + 1; end = list + length;

On Mon, Oct 17, 2016 at 08:22:34PM +0900, Masahiro Yamada wrote:
If fdt_getprop() fails, negative error code should be returned.
[ DTC commit: daa75e8fa5942caa8e97931aed3a1ee0b7edd74b ]
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!
participants (2)
-
Masahiro Yamada
-
Tom Rini