From: Simon Glass Date: Thu, 30 Jun 2016 16:52:09 +0000 (-0600) Subject: mkimage: Require a data file when auto-fit is used X-Git-Tag: v2016.09-rc1~124 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e324a92531e1dc092949b8a00745afd2328e178e;p=u-boot 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 Reviewed-by: Tom Rini --- 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; }