/* hold one more reference to the scsi_device that will get released
* in __release, in case a logout is happening while fs is mounted
*/
- scsi_device_get(scsi_device);
+ if (scsi_device_get(scsi_device))
+ goto err_put_disk;
osd_dev_init(&oud->od, scsi_device);
/* Detect the OSD Version */
error = __detect_osd(oud);
if (error) {
OSD_ERR("osd detection failed, non-compatible OSD device\n");
- goto err_put_disk;
+ goto err_put_sdev;
}
/* init the char-device for communication with user-mode */
err_put_cdev:
cdev_del(&oud->cdev);
-err_put_disk:
+err_put_sdev:
scsi_device_put(scsi_device);
+err_put_disk:
put_disk(disk);
err_free_osd:
dev_set_drvdata(dev, NULL);