summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ubi-utils/ubiformat.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ubi-utils/ubiformat.c b/ubi-utils/ubiformat.c
index 64afad2..be40e52 100644
--- a/ubi-utils/ubiformat.c
+++ b/ubi-utils/ubiformat.c
@@ -550,6 +550,7 @@ static int format(libmtd_t libmtd, const struct mtd_dev_info *mtd,
struct ubi_vtbl_record *vtbl;
int eb1 = -1, eb2 = -1;
long long ec1 = -1, ec2 = -1;
+ int ret = -1;
write_size = UBI_EC_HDR_SIZE + mtd->subpage_size - 1;
write_size /= mtd->subpage_size;
@@ -643,8 +644,10 @@ static int format(libmtd_t libmtd, const struct mtd_dev_info *mtd,
if (!args.quiet && !args.verbose)
printf("\n");
- if (novtbl)
+ if (novtbl) {
+ ret = 0;
goto out_free;
+ }
if (eb1 == -1 || eb2 == -1) {
errmsg("no eraseblocks for volume table");
@@ -669,7 +672,7 @@ static int format(libmtd_t libmtd, const struct mtd_dev_info *mtd,
out_free:
free(hdr);
- return -1;
+ return ret;
}
int main(int argc, char * const argv[])