[U-Boot,3/4] lib: decode_timing_property should return -NOENT when proprty is not found

Message ID 20190209133957.12713-4-megous@megous.com
State Superseded
Delegated to: Tom Rini
Headers show
Series
  • Random small sunxi fixes
Related show

Commit Message

Ondřej Jirman Feb. 9, 2019, 1:39 p.m.
From: Ondrej Jirman <megous@megous.com>

Length may be unitialized when fdt_getprop fails.

Signed-off-by: Ondřej Jirman <megous@megous.com>
---
 lib/fdtdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 18663ce6bd..3510de78e1 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -980,7 +980,7 @@  static int decode_timing_property(const void *blob, int node, const char *name,
 	if (!prop) {
 		debug("%s: could not find property %s\n",
 		      fdt_get_name(blob, node, NULL), name);
-		return length;
+		return -ENOENT;
 	}
 
 	if (length == sizeof(u32)) {