aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/vmt.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-17 06:09:09 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-26 12:15:15 -0500
commit450f872a8e1763c883c9f723e6937b7ed223e6d3 (patch)
tree256c2d6a485a4d5b4d38d2e591eb8c9105b38f90 /drivers/mtd/ubi/vmt.c
parentc63a491d3737aec3c47c5e785d87021752ad9fa6 (diff)
UBI: get device when opening volume
When a volume is opened, get its kref via get_device() call. And put the reference when closing the volume. With this, we may have a bit saner volume delete. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/vmt.c')
-rw-r--r--drivers/mtd/ubi/vmt.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index ec2dd3c65c43..9dd3689aecd3 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -435,7 +435,6 @@ int ubi_remove_volume(struct ubi_volume_desc *desc)
435 vol->eba_tbl = NULL; 435 vol->eba_tbl = NULL;
436 cdev_del(&vol->cdev); 436 cdev_del(&vol->cdev);
437 volume_sysfs_close(vol); 437 volume_sysfs_close(vol);
438 kfree(desc);
439 438
440 spin_lock(&ubi->volumes_lock); 439 spin_lock(&ubi->volumes_lock);
441 ubi->rsvd_pebs -= reserved_pebs; 440 ubi->rsvd_pebs -= reserved_pebs;
@@ -453,10 +452,6 @@ int ubi_remove_volume(struct ubi_volume_desc *desc)
453 spin_unlock(&ubi->volumes_lock); 452 spin_unlock(&ubi->volumes_lock);
454 453
455 paranoid_check_volumes(ubi); 454 paranoid_check_volumes(ubi);
456 mutex_unlock(&ubi->volumes_mutex);
457 module_put(THIS_MODULE);
458 return 0;
459
460out: 455out:
461 mutex_unlock(&ubi->volumes_mutex); 456 mutex_unlock(&ubi->volumes_mutex);
462 return err; 457 return err;