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:
parent
e5dda9d5e2
commit
435aaf6279
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue