Commit b12a81c4 authored by Simon Glass's avatar Simon Glass Committed by Tom Rini

mkimage: Close the file when unable to get its size

There is a missing close() on the error path. Add it.

Reported-by: Coverity (CID: 138496)
Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarTom Rini <trini@konsulko.com>
parent 4708a07c
......@@ -107,6 +107,7 @@ int imagetool_get_filesize(struct image_tool_params *params, const char *fname)
if (fstat(fd, &sbuf) < 0) {
fprintf(stderr, "%s: Can't stat %s: %s\n",
params->cmdname, fname, strerror(errno));
close(fd);
return -1;
}
close(fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment