[PATCH 3/6] bootm: fit: Print error when image is not hashed

Sascha Hauer s.hauer at pengutronix.de
Tue May 10 07:08:06 PDT 2016


When fit is configured to check hashes print an error when an image
does not contain hashes instead of failing silently.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/image-fit.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/common/image-fit.c b/common/image-fit.c
index 4f5c1f1..a6e1082 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -436,9 +436,12 @@ static int fit_open_image(struct fit_handle *handle, const char *unit, const voi
 			if (ret < 0)
 				return ret;
 		}
+
+		if (ret < 0) {
+			pr_err("image '%s': '%s' does not have hashes\n", unit, desc);
+			return ret;
+		}
 	}
-	if (ret < 0)
-		return ret;
 
 	*outdata = data;
 	*outsize = data_len;
-- 
2.8.0.rc3




More information about the barebox mailing list