]> git.sur5r.net Git - u-boot/blobdiff - tools/fit_image.c
x86: acpi: Return table length in acpi_create_madt_lapics()
[u-boot] / tools / fit_image.c
index 6e5c143803c627c4f92de28e4d79e61363bfee27..0551572b04576971d4fd4af4e9085b89d5715964 100644 (file)
@@ -343,7 +343,6 @@ static int fit_build(struct image_tool_params *params, const char *fname)
        if (ret != size) {
                fprintf(stderr, "%s: Can't write %s: %s\n",
                        params->cmdname, fname, strerror(errno));
-               close(fd);
                goto err;
        }
        close(fd);
@@ -537,8 +536,8 @@ static int fit_import_data(struct image_tool_params *params, const char *fname)
        if (fd < 0) {
                fprintf(stderr, "%s: Can't open %s: %s\n",
                        params->cmdname, fname, strerror(errno));
-               ret = -EIO;
-               goto err;
+               free(fdt);
+               return -EIO;
        }
        if (write(fd, fdt, new_size) != new_size) {
                debug("%s: Failed to write external data to file %s\n",