diff mbox series

[u-boot,v2019.04-aspeed-openbmc,3/7] image: Return an error message from fit_config_verify_sig()

Message ID 20210128105304.401058-4-joel@jms.id.au
State New
Headers show
Series Blackport SHA512 for FIT | expand

Commit Message

Joel Stanley Jan. 28, 2021, 10:53 a.m. UTC
From: Simon Glass <sjg@chromium.org>

This function only returns an error message sometimes. Update it to always
return an error message if one is available. This makes it easier to see
what went wrong.

Signed-off-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit 472f9113dbbbed88345f3d38de3ff37ca163508e)
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 common/image-sig.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Klaus Heinrich Kiwi Jan. 28, 2021, 7:49 p.m. UTC | #1
On 1/28/2021 7:53 AM, Joel Stanley wrote:
> From: Simon Glass <sjg@chromium.org>
> 
> This function only returns an error message sometimes. Update it to always
> return an error message if one is available. This makes it easier to see
> what went wrong.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> (cherry picked from commit 472f9113dbbbed88345f3d38de3ff37ca163508e)
> Signed-off-by: Joel Stanley <joel@jms.id.au>

Reviewed-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
diff mbox series

Patch

diff --git a/common/image-sig.c b/common/image-sig.c
index 004fbc525b5c..48532b15a31a 100644
--- a/common/image-sig.c
+++ b/common/image-sig.c
@@ -470,13 +470,14 @@  static int fit_config_verify_sig(const void *fit, int conf_noffset,
 		goto error;
 	}
 
-	return verified ? 0 : -EPERM;
+	if (verified)
+		return 0;
 
 error:
 	printf(" error!\n%s for '%s' hash node in '%s' config node\n",
 	       err_msg, fit_get_name(fit, noffset, NULL),
 	       fit_get_name(fit, conf_noffset, NULL));
-	return -1;
+	return -EPERM;
 }
 
 int fit_config_verify_required_sigs(const void *fit, int conf_noffset,