Commit b06ab129 authored by Mike Anderson's avatar Mike Anderson Committed by James Bottomley

[SCSI] fix scsi_find_device()

parent c26332f5
...@@ -605,8 +605,8 @@ static inline Scsi_Device *scsi_find_device(struct Scsi_Host *shost, ...@@ -605,8 +605,8 @@ static inline Scsi_Device *scsi_find_device(struct Scsi_Host *shost,
list_for_each_entry (sdev, &shost->my_devices, siblings) list_for_each_entry (sdev, &shost->my_devices, siblings)
if (sdev->channel == channel && sdev->id == pun if (sdev->channel == channel && sdev->id == pun
&& sdev->lun ==lun) && sdev->lun ==lun)
break;
return sdev; return sdev;
return NULL;
} }
/* /*
......
...@@ -1758,7 +1758,7 @@ int scsi_add_single_device(uint host, uint channel, uint id, uint lun) ...@@ -1758,7 +1758,7 @@ int scsi_add_single_device(uint host, uint channel, uint id, uint lun)
shost = scsi_host_hn_get(host); shost = scsi_host_hn_get(host);
if (!shost) if (!shost)
return -ENODEV; return -ENODEV;
if(scsi_find_device(shost, channel, id, lun) == NULL) if(scsi_find_device(shost, channel, id, lun) != NULL)
goto out; goto out;
if (scsi_probe_and_add_lun(shost, NULL, channel, id, lun, NULL) == if (scsi_probe_and_add_lun(shost, NULL, channel, id, lun, NULL) ==
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment