Skip to content

Commit a247e07

Browse files
nomismartinkpetersen
authored andcommitted
scsi: sr: Fix sr_probe() missing mutex_destroy
If the device minor cannot be allocated or the cdrom fails to be registered then the mutex should be destroyed. Link: https://lore.kernel.org/r/06e9de38-eeed-1cab-5e08-e889288935b3@0882a8b5-c6c3-11e9-b005-00805fc181fe Fixes: 51a8588 ("scsi: sr: get rid of sr global mutex") Signed-off-by: Simon Arlott <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 08e9cbe commit a247e07

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/scsi/sr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@ static int sr_probe(struct device *dev)
813813

814814
fail_put:
815815
put_disk(disk);
816+
mutex_destroy(&cd->lock);
816817
fail_free:
817818
kfree(cd);
818819
fail:

0 commit comments

Comments
 (0)