linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] scsi: sr: Fix sr_probe() missing mutex_destroy
@ 2020-05-30  9:32 Simon Arlott
  2020-05-30  9:33 ` [PATCH 2/2] scsi: sr: Fix sr_probe() missing deallocate of device minor Simon Arlott
  2020-05-30 16:24 ` [PATCH 1/2] scsi: sr: Fix sr_probe() missing mutex_destroy Bart Van Assche
  0 siblings, 2 replies; 6+ messages in thread
From: Simon Arlott @ 2020-05-30  9:32 UTC (permalink / raw)
  To: Martin K . Petersen, James E.J. Bottomley, Jens Axboe
  Cc: linux-scsi, Merlijn Wajer, Linux Kernel Mailing List

If the device minor cannot be allocated or the cdrom fails to be
registered then the mutex should be destroyed.

Signed-off-by: Simon Arlott <simon@octiron.net>
---
 drivers/scsi/sr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index d2fe3fa470f9..8d062d4f3ce0 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -817,6 +817,7 @@ static int sr_probe(struct device *dev)
 
 fail_put:
 	put_disk(disk);
+	mutex_destroy(&cd->lock);
 fail_free:
 	kfree(cd);
 fail:
-- 
2.17.1

-- 
Simon Arlott

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

end of thread, other threads:[~2020-05-30 18:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-30  9:32 [PATCH 1/2] scsi: sr: Fix sr_probe() missing mutex_destroy Simon Arlott
2020-05-30  9:33 ` [PATCH 2/2] scsi: sr: Fix sr_probe() missing deallocate of device minor Simon Arlott
2020-05-30 16:24   ` Bart Van Assche
2020-05-30 16:24 ` [PATCH 1/2] scsi: sr: Fix sr_probe() missing mutex_destroy Bart Van Assche
2020-05-30 16:41   ` James Bottomley
2020-05-30 18:14     ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).