diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-10-17 11:22:34 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-10-24 12:04:40 (GMT) |
commit | 01ae56cfcb3f6bbcd1e1cbd283ae2b8b38587664 (patch) | |
tree | 49a9b96a2e67eee08e39d910b637770c00b0877e | |
parent | 7c9786d61f951dd8d031e88e198e0ae88b8da2b3 (diff) | |
download | u-boot-01ae56cfcb3f6bbcd1e1cbd283ae2b8b38587664.tar.xz |
libfdt: fix fdt_stringlist_search()
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>
-rw-r--r-- | lib/libfdt/fdt_ro.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |