From: Masahiro Yamada Date: Mon, 17 Oct 2016 11:22:34 +0000 (+0900) Subject: libfdt: fix fdt_stringlist_search() X-Git-Tag: v2016.11-rc3~48 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=01ae56cfcb3f6bbcd1e1cbd283ae2b8b38587664;p=u-boot libfdt: fix fdt_stringlist_search() If fdt_getprop() fails, negative error code should be returned. [ DTC commit: daa75e8fa5942caa8e97931aed3a1ee0b7edd74b ] Signed-off-by: Masahiro Yamada Signed-off-by: David Gibson --- diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c index fc08981a2c..1be9538fd2 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;