summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2011-09-15 23:50:15 +0000
committerWolfgang Denk <wd@denx.de>2011-10-05 22:03:11 +0200
commit163967905f9e41232d5f7c525a9811a200fe30ba (patch)
treec6e00b01a655e2a3ce2e5c3f2da57a53644d71b6
parent9400f8fa7c064fd1e1c7ae714920f6067eec3ca4 (diff)
downloadu-boot-imx-163967905f9e41232d5f7c525a9811a200fe30ba.zip
u-boot-imx-163967905f9e41232d5f7c525a9811a200fe30ba.tar.gz
u-boot-imx-163967905f9e41232d5f7c525a9811a200fe30ba.tar.bz2
mkimage: ublimage must return if the header is not verified
Each image handler must return a not-zero velue if the header is not recognized to allow the main program to iterate to the next handler. Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Heiko Schocher <hs@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
-rw-r--r--tools/ublimage.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/ublimage.c b/tools/ublimage.c
index 9987462..d6b4017 100644
--- a/tools/ublimage.c
+++ b/tools/ublimage.c
@@ -214,6 +214,11 @@ static int ublimage_check_image_types(uint8_t type)
static int ublimage_verify_header(unsigned char *ptr, int image_size,
struct mkimage_params *params)
{
+ struct ubl_header *ubl_hdr = (struct ubl_header *)ptr;
+
+ if ((ubl_hdr->magic & 0xFFFFFF00) != UBL_MAGIC_BASE)
+ return -1;
+
return 0;
}