diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-12-17 06:09:09 -0500 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-12-26 12:15:15 -0500 |
commit | 450f872a8e1763c883c9f723e6937b7ed223e6d3 (patch) | |
tree | 256c2d6a485a4d5b4d38d2e591eb8c9105b38f90 /drivers/mtd/ubi/cdev.c | |
parent | c63a491d3737aec3c47c5e785d87021752ad9fa6 (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/cdev.c')
-rw-r--r-- | drivers/mtd/ubi/cdev.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 24344ba3cfed..35d34b675c78 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c | |||
@@ -635,9 +635,12 @@ static int ubi_cdev_ioctl(struct inode *inode, struct file *file, | |||
635 | } | 635 | } |
636 | 636 | ||
637 | err = ubi_remove_volume(desc); | 637 | err = ubi_remove_volume(desc); |
638 | if (err) | 638 | /* |
639 | ubi_close_volume(desc); | 639 | * The volume is deleted, and the 'struct ubi_volume' object |
640 | 640 | * will be freed when 'ubi_close_volume()' will call | |
641 | * 'put_device()'. | ||
642 | */ | ||
643 | ubi_close_volume(desc); | ||
641 | break; | 644 | break; |
642 | } | 645 | } |
643 | 646 | ||