Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84228
b: refs/heads/master
c: 450f872
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Dec 26, 2007
1 parent bb55141 commit e89ec0a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c63a491d3737aec3c47c5e785d87021752ad9fa6
refs/heads/master: 450f872a8e1763c883c9f723e6937b7ed223e6d3
9 changes: 6 additions & 3 deletions trunk/drivers/mtd/ubi/cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,12 @@ static int ubi_cdev_ioctl(struct inode *inode, struct file *file,
}

err = ubi_remove_volume(desc);
if (err)
ubi_close_volume(desc);

/*
* The volume is deleted, and the 'struct ubi_volume' object
* will be freed when 'ubi_close_volume()' will call
* 'put_device()'.
*/
ubi_close_volume(desc);
break;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/mtd/ubi/kapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode)
vol->exclusive = 1;
break;
}
get_device(&vol->dev);
spin_unlock(&ubi->volumes_lock);

desc->vol = vol;
Expand Down Expand Up @@ -274,6 +275,7 @@ void ubi_close_volume(struct ubi_volume_desc *desc)
spin_unlock(&vol->ubi->volumes_lock);

kfree(desc);
put_device(&vol->dev);
module_put(THIS_MODULE);
}
EXPORT_SYMBOL_GPL(ubi_close_volume);
Expand Down
5 changes: 0 additions & 5 deletions trunk/drivers/mtd/ubi/vmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit e89ec0a

Please sign in to comment.