From patchwork Wed Mar 18 17:43:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 243856 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Wed, 18 Mar 2020 11:43:57 -0600 Subject: [PATCH v2 03/14] image: Return an error message from fit_config_verify_sig() In-Reply-To: <20200318174408.77473-1-sjg@chromium.org> References: <20200318174408.77473-1-sjg@chromium.org> Message-ID: <20200318174408.77473-4-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 --- Changes in v2: None common/image-sig.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/image-sig.c b/common/image-sig.c index 639a112450..13ccd50bc5 100644 --- a/common/image-sig.c +++ b/common/image-sig.c @@ -499,13 +499,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,