diff --git a/super1.c b/super1.c index 4f20cc3..fbc2e8f 100644 --- a/super1.c +++ b/super1.c @@ -1096,7 +1096,7 @@ static int write_init_super1(struct supertype *st) unsigned long long dsize, array_size; unsigned long long sb_offset, headroom; - for (di = st->info; di && ! rv ; di = di->next) { + for (di = st->info; di; di = di->next) { if (di->disk.state == 1) continue; if (di->fd < 0) @@ -1242,6 +1242,8 @@ static int write_init_super1(struct supertype *st) rv = st->ss->write_bitmap(st, di->fd); close(di->fd); di->fd = -1; + if (rv) + goto error_out; } error_out: if (rv)