aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cdrom
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cdrom')
-rw-r--r--drivers/cdrom/gdrom.c8
-rw-r--r--drivers/cdrom/viocd.c10
2 files changed, 16 insertions, 2 deletions
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index 1772fd914fb9..261107d1457c 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -493,12 +493,18 @@ static struct cdrom_device_ops gdrom_ops = {
493 493
494static int gdrom_bdops_open(struct block_device *bdev, fmode_t mode) 494static int gdrom_bdops_open(struct block_device *bdev, fmode_t mode)
495{ 495{
496 return cdrom_open(gd.cd_info, bdev, mode); 496 int ret;
497 lock_kernel();
498 ret = cdrom_open(gd.cd_info, bdev, mode);
499 unlock_kernel();
500 return ret;
497} 501}
498 502
499static int gdrom_bdops_release(struct gendisk *disk, fmode_t mode) 503static int gdrom_bdops_release(struct gendisk *disk, fmode_t mode)
500{ 504{
505 lock_kernel();
501 cdrom_release(gd.cd_info, mode); 506 cdrom_release(gd.cd_info, mode);
507 unlock_kernel();
502 return 0; 508 return 0;
503} 509}
504 510
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index 16dada0627ee..56bf9f44700c 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -154,13 +154,21 @@ static const struct file_operations proc_viocd_operations = {
154static int viocd_blk_open(struct block_device *bdev, fmode_t mode) 154static int viocd_blk_open(struct block_device *bdev, fmode_t mode)
155{ 155{
156 struct disk_info *di = bdev->bd_disk->private_data; 156 struct disk_info *di = bdev->bd_disk->private_data;
157 return cdrom_open(&di->viocd_info, bdev, mode); 157 int ret;
158
159 lock_kernel();
160 ret = cdrom_open(&di->viocd_info, bdev, mode);
161 unlock_kernel();
162
163 return ret;
158} 164}
159 165
160static int viocd_blk_release(struct gendisk *disk, fmode_t mode) 166static int viocd_blk_release(struct gendisk *disk, fmode_t mode)
161{ 167{
162 struct disk_info *di = disk->private_data; 168 struct disk_info *di = disk->private_data;
169 lock_kernel();
163 cdrom_release(&di->viocd_info, mode); 170 cdrom_release(&di->viocd_info, mode);
171 unlock_kernel();
164 return 0; 172 return 0;
165} 173}
166 174