Skip to content

Commit

Permalink
cdrom_open() forgets to unlock on -EROFS failure exits
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Al Viro authored and Jens Axboe committed Sep 26, 2007
1 parent 4942de4 commit ae3ba4f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
@@ -1032,6 +1032,10 @@ int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp)
check_disk_change(ip->i_bdev);
return 0;
err_release:
if (CDROM_CAN(CDC_LOCK) && cdi->options & CDO_LOCK) {
cdi->ops->lock_door(cdi, 0);
cdinfo(CD_OPEN, "door unlocked.\n");
}
cdi->ops->release(cdi);
err:
cdi->use_count--;

0 comments on commit ae3ba4f

Please sign in to comment.