diff options
author | James Smart <James.Smart@Emulex.Com> | 2007-08-02 11:09:51 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-08-01 13:18:23 -0400 |
commit | 549e55cd2a1b83ea45ac17fb6c309654a3d371a4 (patch) | |
tree | 0abf10a28b177e129932c62b3b94994ce4f3aadb /drivers/scsi/lpfc/lpfc_ct.c | |
parent | a58cbd5212fff2d4bba0bf58e778f02069597294 (diff) |
[SCSI] lpfc 8.2.2 : Fix locking around HBA's port_list
Cleans up a lot of bad behaviors that have been in this area a while
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_ct.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_ct.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index edbebffa26cf..43e2e33f9a07 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c | |||
@@ -390,17 +390,19 @@ lpfc_ct_cmd(struct lpfc_vport *vport, struct lpfc_dmabuf *inmp, | |||
390 | return 0; | 390 | return 0; |
391 | } | 391 | } |
392 | 392 | ||
393 | static struct lpfc_vport * | 393 | struct lpfc_vport * |
394 | lpfc_find_vport_by_did(struct lpfc_hba *phba, uint32_t did) { | 394 | lpfc_find_vport_by_did(struct lpfc_hba *phba, uint32_t did) { |
395 | |||
396 | struct lpfc_vport *vport_curr; | 395 | struct lpfc_vport *vport_curr; |
396 | unsigned long flags; | ||
397 | 397 | ||
398 | spin_lock_irqsave(&phba->hbalock, flags); | ||
398 | list_for_each_entry(vport_curr, &phba->port_list, listentry) { | 399 | list_for_each_entry(vport_curr, &phba->port_list, listentry) { |
399 | if ((vport_curr->fc_myDID) && | 400 | if ((vport_curr->fc_myDID) && (vport_curr->fc_myDID == did)) { |
400 | (vport_curr->fc_myDID == did)) | 401 | spin_unlock_irqrestore(&phba->hbalock, flags); |
401 | return vport_curr; | 402 | return vport_curr; |
403 | } | ||
402 | } | 404 | } |
403 | 405 | spin_unlock_irqrestore(&phba->hbalock, flags); | |
404 | return NULL; | 406 | return NULL; |
405 | } | 407 | } |
406 | 408 | ||