aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2012-12-13 17:41:14 +0100
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-01-15 10:37:56 +0200
commitc42d7667aaa5d90b5ffc04f86dd691fb174c34f3 (patch)
treecec3eee75cadfcc18fe52ceb0d446e00027e1344
parent93d08c464eabc5c667972be155226008c2eb7c9f (diff)
ubiformat: fix error path
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>
-rw-r--r--ubi-utils/ubiformat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ubi-utils/ubiformat.c b/ubi-utils/ubiformat.c
index c49af29..899f9fc 100644
--- a/ubi-utils/ubiformat.c
+++ b/ubi-utils/ubiformat.c
@@ -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;
}
}