summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi/vmt.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-17 13:09:09 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-26 19:15:15 +0200
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)
vol->eba_tbl = NULL;
cdev_del(&vol->cdev);
volume_sysfs_close(vol);
- kfree(desc);
spin_lock(&ubi->volumes_lock);
ubi->rsvd_pebs -= reserved_pebs;
@@ -453,10 +452,6 @@ int ubi_remove_volume(struct ubi_volume_desc *desc)
spin_unlock(&ubi->volumes_lock);
paranoid_check_volumes(ubi);
- mutex_unlock(&ubi->volumes_mutex);
- module_put(THIS_MODULE);
- return 0;
-
out:
mutex_unlock(&ubi->volumes_mutex);
return err;