From: Eric Nelson Date: Sun, 27 Nov 2016 08:27:43 -0700 Subject: [U-Boot] [PATCH RESEND] imx-common: hab: fix return value from hab_auth_img Message-ID: <1480260463-1517-1-git-send-email-eric@nelint.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The authenticate_image routine returns a boolean to indicate a valid (1) or invalid (0) image. The hab_auth_img should return CMD_RET_SUCCESS to indicate success (a valid image), but currently doesn't. Before this patch, a valid image at addres 0x12000000 with an IVT offset of 0x7a8000 will produce the following: => if hab_auth_img 0x12000000 0x7a8000 ; then > echo worked > else > echo failed > fi Authenticate image from DDR location 0x12000000... Secure boot enabled HAB Configuration: 0xcc, HAB State: 0x99 failed Signed-off-by: Eric Nelson --- arch/arm/imx-common/hab.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/imx-common/hab.c b/arch/arm/imx-common/hab.c index 6731825..e2c04f9 100644 --- a/arch/arm/imx-common/hab.c +++ b/arch/arm/imx-common/hab.c @@ -486,7 +486,9 @@ static int do_authenticate_image(cmd_tbl_t *cmdtp, int flag, int argc, rcode = authenticate_image(addr, ivt_offset); - return rcode; + return (rcode != 0) + ? CMD_RET_SUCCESS + : CMD_RET_FAILURE; } U_BOOT_CMD( -- 2.7.4