9
0
Fork 0

bootstrap: Warn if image size in BB header is zero

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Andrey Smirnov 2015-05-06 12:32:13 -07:00 committed by Sascha Hauer
parent e5dda9d5e2
commit 435aaf6279
1 changed files with 5 additions and 1 deletions

View File

@ -58,8 +58,12 @@ static unsigned int get_image_size(void *head)
unsigned int ret = 0;
unsigned int *psize = head + BAREBOX_HEAD_SIZE_OFFSET;
if (is_barebox_head(head))
if (is_barebox_head(head)) {
ret = *psize;
if (!ret)
bootstrap_err(
"image has correct magic, but the length is zero\n");
}
debug("Detected barebox image size %u\n", ret);
return ret;