aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-10-24 09:19:16 +0200
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-11-20 19:06:22 +0100
commit2b3b3511bd360487bfa48b6052aae5778fa73c96 (patch)
tree9394e31b4506692a996c268997973ea59f1594a1
parent24ca49b33af98d54d6cd2e845f071f6565345ffd (diff)
downloadu-boot-2b3b3511bd360487bfa48b6052aae5778fa73c96.zip
u-boot-2b3b3511bd360487bfa48b6052aae5778fa73c96.tar.gz
u-boot-2b3b3511bd360487bfa48b6052aae5778fa73c96.tar.bz2
mkimage: do not write incorrect error message
When running 'mkimage -l' is called for a valid StarFive file an error message "Error: invalid marker bytes" is written by the Renesas SPKG driver. mkimage -l may be invoked without specifying an image type. In this case mkimage iterates over all image type drivers to find the one that matches. None of the non-matching drivers should write an error message. Fix the Renesas SPKG driver. Fixes: afdfcb11f97c ("tools: spkgimage: add Renesas SPKG format") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--tools/renesas_spkgimage.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/renesas_spkgimage.c b/tools/renesas_spkgimage.c
index 5cd81dd..ce3b2b2 100644
--- a/tools/renesas_spkgimage.c
+++ b/tools/renesas_spkgimage.c
@@ -147,7 +147,8 @@ static int spkgimage_verify_header(unsigned char *ptr, int size,
/* Check the marker bytes */
if (memcmp(header->marker, marker, 4)) {
- fprintf(stderr, "Error: invalid marker bytes\n");
+ if (param->type == IH_TYPE_RENESAS_SPKG)
+ fprintf(stderr, "Error: invalid marker bytes\n");
return -EINVAL;
}