mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] hab: bail out with error when SRK hash write fails
@ 2024-07-15 12:36 Sascha Hauer
  2024-07-15 12:36 ` [PATCH 2/3] hab: ahab: cosmetic change Sascha Hauer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sascha Hauer @ 2024-07-15 12:36 UTC (permalink / raw)
  To: Barebox List

When we fail to write fuses during writing the SRK hash, then bail
out with an error instead of silently ignoring it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/hab/hab.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hab/hab.c b/drivers/hab/hab.c
index 28a091841a..288f440bd2 100644
--- a/drivers/hab/hab.c
+++ b/drivers/hab/hab.c
@@ -280,9 +280,11 @@ static int imx_ahab_write_srk_hash(const u8 *__newsrk, unsigned flags)
 
 	for (i = 0; i < 32 / sizeof(u32); i++) {
 		ret = ele_write_fuse(0x80 + i, newsrk[i], false, &resp);
-		if (ret)
+		if (ret) {
 			pr_err("Writing fuse index 0x%02x failed with %d, response 0x%08x\n",
 			       i, ret, resp);
+			return ret;
+		}
 	}
 
 	return 0;
-- 
2.39.2




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-16  7:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-15 12:36 [PATCH 1/3] hab: bail out with error when SRK hash write fails Sascha Hauer
2024-07-15 12:36 ` [PATCH 2/3] hab: ahab: cosmetic change Sascha Hauer
2024-07-15 12:36 ` [PATCH 3/3] hab: ahab: use pr_* for printing Sascha Hauer
2024-07-16  7:03 ` [PATCH 1/3] hab: bail out with error when SRK hash write fails Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox