summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2015-05-06 12:32:13 -0700
committerSascha Hauer <s.hauer@pengutronix.de>2015-05-07 09:49:42 +0200
commit435aaf62799d029d1d6d6da643fdc01fc981feff (patch)
tree9d4e3368c7e4efa06dbbe0b7439d6a2df856f483 /lib
parente5dda9d5e2f27bc8cabf8f4915fadad8112e5f8b (diff)
downloadbarebox-435aaf62799d029d1d6d6da643fdc01fc981feff.tar.gz
barebox-435aaf62799d029d1d6d6da643fdc01fc981feff.tar.xz
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/bootstrap/devfs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c
index b6edec7e2d..5a64477eed 100644
--- a/lib/bootstrap/devfs.c
+++ b/lib/bootstrap/devfs.c
@@ -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;