diff options
Diffstat (limited to 'drivers/cdrom/gdrom.c')
-rw-r--r-- | drivers/cdrom/gdrom.c | 8 |
1 files changed, 7 insertions, 1 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 | ||
494 | static int gdrom_bdops_open(struct block_device *bdev, fmode_t mode) | 494 | static 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 | ||
499 | static int gdrom_bdops_release(struct gendisk *disk, fmode_t mode) | 503 | static 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 | ||