[11/15] ubiformat: don't leak file descriptors
diff mbox series

Message ID 20191110153059.28878-12-david.oberhollenzer@sigma-star.at
State New
Headers show
Series
  • mtd-utils: cleanup resource leaks
Related show

Commit Message

David Oberhollenzer Nov. 10, 2019, 3:30 p.m. UTC
The original code had a 'goto out_close' directly after a return error
code, which is obviously not what was intended.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
---
 ubi-utils/ubiformat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/ubi-utils/ubiformat.c b/ubi-utils/ubiformat.c
index a90627c..64afad2 100644
--- a/ubi-utils/ubiformat.c
+++ b/ubi-utils/ubiformat.c
@@ -426,8 +426,8 @@  static int flash_image(libmtd_t libmtd, const struct mtd_dev_info *mtd,
 	}
 
 	if (st_size % mtd->eb_size) {
-		return sys_errmsg("file \"%s\" (size %lld bytes) is not multiple of ""eraseblock size (%d bytes)",
-				  args.image, (long long)st_size, mtd->eb_size);
+		sys_errmsg("file \"%s\" (size %lld bytes) is not multiple of ""eraseblock size (%d bytes)",
+			  args.image, (long long)st_size, mtd->eb_size);
 		goto out_close;
 	}