aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 76577fae60fa..a0975c78b968 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -870,8 +870,12 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
870 out_free_sdev: 870 out_free_sdev:
871 if (res == SCSI_SCAN_LUN_PRESENT) { 871 if (res == SCSI_SCAN_LUN_PRESENT) {
872 if (sdevp) { 872 if (sdevp) {
873 scsi_device_get(sdev); 873 if (scsi_device_get(sdev) == 0) {
874 *sdevp = sdev; 874 *sdevp = sdev;
875 } else {
876 __scsi_remove_device(sdev);
877 res = SCSI_SCAN_NO_RESPONSE;
878 }
875 } 879 }
876 } else { 880 } else {
877 if (sdev->host->hostt->slave_destroy) 881 if (sdev->host->hostt->slave_destroy)