We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a247e07 commit 6555781Copy full SHA for 6555781
drivers/scsi/sr.c
@@ -793,7 +793,7 @@ static int sr_probe(struct device *dev)
793
cd->cdi.disk = disk;
794
795
if (register_cdrom(&cd->cdi))
796
- goto fail_put;
+ goto fail_minor;
797
798
/*
799
* Initialize block layer runtime PM stuffs before the
@@ -811,6 +811,10 @@ static int sr_probe(struct device *dev)
811
812
return 0;
813
814
+fail_minor:
815
+ spin_lock(&sr_index_lock);
816
+ clear_bit(minor, sr_index_bits);
817
+ spin_unlock(&sr_index_lock);
818
fail_put:
819
put_disk(disk);
820
mutex_destroy(&cd->lock);
0 commit comments