[SCSI] bfa: IOC fixes, check for IOC down condition.
[safe/jmp/linux-2.6] / drivers / scsi / scsi_scan.c
index 5d9b513..4bc8b77 100644 (file)
@@ -1339,8 +1339,10 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
                sdev = scsi_alloc_sdev(starget, 0, NULL);
                if (!sdev)
                        return 0;
-               if (scsi_device_get(sdev))
+               if (scsi_device_get(sdev)) {
+                       __scsi_remove_device(sdev);
                        return 0;
+               }
        }
 
        sprintf(devname, "host %d channel %d id %d",
@@ -1907,10 +1909,9 @@ struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost)
                goto out;
 
        sdev = scsi_alloc_sdev(starget, 0, NULL);
-       if (sdev) {
-               sdev->sdev_gendev.parent = get_device(&starget->dev);
+       if (sdev)
                sdev->borken = 0;
-       else
+       else
                scsi_target_reap(starget);
        put_device(&starget->dev);
  out: