[Sound-open-firmware] [PATCH 1/3] rimage: show correct error on write failure.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- rimage/baytrail.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rimage/baytrail.c b/rimage/baytrail.c index 12ccd23..ed1c840 100644 --- a/rimage/baytrail.c +++ b/rimage/baytrail.c @@ -159,7 +159,8 @@ int byt_write_modules(struct image *image)
count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); if (count != 1) { - fprintf(stderr, "error: failed to write section header %d\n", i); + fprintf(stderr, "error: failed to write section header %d\n", + -errno); return -errno ; }
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- rimage/rimage.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/rimage/rimage.c b/rimage/rimage.c index 0695ce3..af57f5a 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -208,6 +208,9 @@ static int write_elf_data(struct image *image) goto out; }
+ free(image->prg); + free(image->section); + out: return ret; }
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- rmbox/rmbox.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/rmbox/rmbox.c b/rmbox/rmbox.c index f5e9c34..83d3c6e 100644 --- a/rmbox/rmbox.c +++ b/rmbox/rmbox.c @@ -230,6 +230,8 @@ static int snapshot(const char *name) addr += 4; }
+ fclose(in_fd); + fclose(out_fd); }
return 0; @@ -281,6 +283,7 @@ int main(int argc, char *argv[]) if (out_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", out_file, errno); + fclose(in_fd); return -EIO; }
participants (1)
-
Liam Girdwood