···787787 * erased, so it became unstable and corrupted, and should be788788 * erased.789789 */790790- return 0;790790+ err = 0;791791+ goto out_unlock;791792 }792793793794 if (err)794794- return err;795795+ goto out_unlock;795796796796- if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size)) {797797- mutex_unlock(&ubi->buf_mutex);798798- return 0;799799- }797797+ if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size))798798+ goto out_unlock;800799801800 ubi_err("PEB %d contains corrupted VID header, and the data does not "802801 "contain all 0xFF, this may be a non-UBI PEB or a severe VID "···805806 pnum, ubi->leb_start, ubi->leb_size);806807 ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,807808 ubi->peb_buf1, ubi->leb_size, 1);809809+ err = 1;810810+811811+out_unlock:808812 mutex_unlock(&ubi->buf_mutex);809809- return 1;813813+ return err;810814}811815812816/**