]> www.infradead.org Git - mtd-utils.git/commitdiff
ubiformat: fix error path
authorWolfram Sang <w.sang@pengutronix.de>
Thu, 13 Dec 2012 16:41:14 +0000 (17:41 +0100)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 15 Jan 2013 08:37:56 +0000 (10:37 +0200)
A few error paths were closing the device, although it was not opened
yet.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
ubi-utils/ubiformat.c

index c49af291a1e694fa27ed7d951bb68bfbe8ac6831..899f9fc62fea0f2e941db36dbb666636fc09cf32 100644 (file)
@@ -740,7 +740,7 @@ int main(int argc, char * const argv[])
        if (!is_power_of_2(mtd.min_io_size)) {
                errmsg("min. I/O size is %d, but should be power of 2",
                       mtd.min_io_size);
-               goto out_close;
+               goto out_close_mtd;
        }
 
        if (!mtd_info.sysfs_supported) {
@@ -768,13 +768,13 @@ int main(int argc, char * const argv[])
                /* Do some sanity check */
                if (args.subpage_size > mtd.min_io_size) {
                        errmsg("sub-page cannot be larger than min. I/O unit");
-                       goto out_close;
+                       goto out_close_mtd;
                }
 
                if (mtd.min_io_size % args.subpage_size) {
                        errmsg("min. I/O unit size should be multiple of "
                               "sub-page size");
-                       goto out_close;
+                       goto out_close_mtd;
                }
        }