Commit ae3ba4fd authored by Al Viro's avatar Al Viro Committed by Jens Axboe

cdrom_open() forgets to unlock on -EROFS failure exits

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 4942de4a
...@@ -1032,6 +1032,10 @@ int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp) ...@@ -1032,6 +1032,10 @@ int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp)
check_disk_change(ip->i_bdev); check_disk_change(ip->i_bdev);
return 0; return 0;
err_release: 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); cdi->ops->release(cdi);
err: err:
cdi->use_count--; cdi->use_count--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment