From: Al Viro Date: Wed, 26 Sep 2007 06:20:44 +0000 (+0200) Subject: cdrom_open() forgets to unlock on -EROFS failure exits X-Git-Tag: v2.6.23-rc9~43^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae3ba4fd966e38d8d766d19f7a58b551df8ecc97;p=linux-2.6 cdrom_open() forgets to unlock on -EROFS failure exits Signed-off-by: Al Viro Signed-off-by: Jens Axboe --- diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 67ee3d4b28..79245714f0 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -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--;