aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/vmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/vmt.c')
-rw-r--r--drivers/mtd/ubi/vmt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index 6e135996e42d..a0c6e1e6d465 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -228,7 +228,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req)
228 for (i = 0; i < ubi->vtbl_slots; i++) 228 for (i = 0; i < ubi->vtbl_slots; i++)
229 if (ubi->volumes[i] && 229 if (ubi->volumes[i] &&
230 ubi->volumes[i]->name_len == req->name_len && 230 ubi->volumes[i]->name_len == req->name_len &&
231 strcmp(ubi->volumes[i]->name, req->name) == 0) { 231 !strcmp(ubi->volumes[i]->name, req->name)) {
232 dbg_err("volume \"%s\" exists (ID %d)", req->name, i); 232 dbg_err("volume \"%s\" exists (ID %d)", req->name, i);
233 goto out_unlock; 233 goto out_unlock;
234 } 234 }
@@ -351,6 +351,7 @@ out_acc:
351 spin_lock(&ubi->volumes_lock); 351 spin_lock(&ubi->volumes_lock);
352 ubi->rsvd_pebs -= vol->reserved_pebs; 352 ubi->rsvd_pebs -= vol->reserved_pebs;
353 ubi->avail_pebs += vol->reserved_pebs; 353 ubi->avail_pebs += vol->reserved_pebs;
354 ubi->volumes[vol_id] = NULL;
354out_unlock: 355out_unlock:
355 spin_unlock(&ubi->volumes_lock); 356 spin_unlock(&ubi->volumes_lock);
356 kfree(vol); 357 kfree(vol);
@@ -367,6 +368,7 @@ out_sysfs:
367 spin_lock(&ubi->volumes_lock); 368 spin_lock(&ubi->volumes_lock);
368 ubi->rsvd_pebs -= vol->reserved_pebs; 369 ubi->rsvd_pebs -= vol->reserved_pebs;
369 ubi->avail_pebs += vol->reserved_pebs; 370 ubi->avail_pebs += vol->reserved_pebs;
371 ubi->volumes[vol_id] = NULL;
370 spin_unlock(&ubi->volumes_lock); 372 spin_unlock(&ubi->volumes_lock);
371 volume_sysfs_close(vol); 373 volume_sysfs_close(vol);
372 return err; 374 return err;
@@ -784,7 +786,7 @@ static void paranoid_check_volume(const struct ubi_device *ubi, int vol_id)
784 return; 786 return;
785 787
786fail: 788fail:
787 ubi_err("paranoid check failed"); 789 ubi_err("paranoid check failed for volume %d", vol_id);
788 ubi_dbg_dump_vol_info(vol); 790 ubi_dbg_dump_vol_info(vol);
789 ubi_dbg_dump_vtbl_record(&ubi->vtbl[vol_id], vol_id); 791 ubi_dbg_dump_vtbl_record(&ubi->vtbl[vol_id], vol_id);
790 BUG(); 792 BUG();