summaryrefslogtreecommitdiff
path: root/tools/mkimage.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-06-30 10:52:09 -0600
committerTom Rini <trini@konsulko.com>2016-07-14 18:22:27 -0400
commite324a92531e1dc092949b8a00745afd2328e178e (patch)
tree8716a2910abfa2355c253f913998182013300dbe /tools/mkimage.c
parent3c23c0feacce0f73d7852409a0c634f275cbecfe (diff)
mkimage: Require a data file when auto-fit is used
When auto-fit is used, it is not valid to create a FIT without an image file. Add a check for this to avoid a very confusing error message later ("Can't open (null): Bad address"). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/mkimage.c')
-rw-r--r--tools/mkimage.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/mkimage.c b/tools/mkimage.c
index 66d29abbb0..a36c031159 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -276,6 +276,8 @@ static void process_args(int argc, char **argv)
/* For auto_its, datafile is always 'auto' */
if (!params.auto_its)
params.datafile = datafile;
+ else if (!params.datafile)
+ usage("Missing data file for auto-FIT (use -d)");
} else if (type != IH_TYPE_INVALID) {
params.type = type;
}