Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com>
---
 lib/bootstrap/devfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c
index d7b5185..d071eb3 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;
--
2.1.4

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to