]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/scsi/scsi_sysfs.c
scm: lower SCM_MAX_FD
[net-next-2.6.git] / drivers / scsi / scsi_sysfs.c
index 20ad59dff730289dd3d05768574e8695ea407109..76ee2e784f75085660524fa35143804659735dbd 100644 (file)
@@ -964,10 +964,11 @@ static void __scsi_remove_target(struct scsi_target *starget)
        list_for_each_entry(sdev, &shost->__devices, siblings) {
                if (sdev->channel != starget->channel ||
                    sdev->id != starget->id ||
-                   sdev->sdev_state == SDEV_DEL)
+                   scsi_device_get(sdev))
                        continue;
                spin_unlock_irqrestore(shost->host_lock, flags);
                scsi_remove_device(sdev);
+               scsi_device_put(sdev);
                spin_lock_irqsave(shost->host_lock, flags);
                goto restart;
        }