cdrom_open() forgets to unlock on -EROFS failure exits
PATCH 1/1 cdrom_open() forgets to unlock on -EROFS failure exits
Signed-off-by Al Viro <[email protected]>
--- drivers/cdrom/cdrom.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/cdrom/cdrom.c +4 -0
@@ -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--;
Signature · 1 line
1.5.3.GIT
Quoted 23 lines · Al Viro
Signed-off-by Al Viro <[email protected]>--- drivers/cdrom/cdrom.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)drivers/cdrom/cdrom.c +4
-0@@ -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--;Signature · 1 line
1.5.3.GIT
Looks good Al, applied.
Signature · 1 line
Jens Axboe