public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cdrom_open() forgets to unlock on -EROFS failure exits
@ 2007-09-26  0:54 Al Viro
  2007-09-26  6:19 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2007-09-26  0:54 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, axboe


Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/cdrom/cdrom.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 67ee3d4..7924571 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--;
-- 
1.5.3.GIT



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-26  6:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-26  0:54 [PATCH] cdrom_open() forgets to unlock on -EROFS failure exits Al Viro
2007-09-26  6:19 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox