diff options
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 853223947d7a..5fd35281f405 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -1166,13 +1166,14 @@ lpfc_get_scsi_buf_s3(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) | |||
1166 | static struct lpfc_scsi_buf* | 1166 | static struct lpfc_scsi_buf* |
1167 | lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) | 1167 | lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) |
1168 | { | 1168 | { |
1169 | struct lpfc_scsi_buf *lpfc_cmd ; | 1169 | struct lpfc_scsi_buf *lpfc_cmd, *lpfc_cmd_next; |
1170 | unsigned long gflag = 0; | 1170 | unsigned long gflag = 0; |
1171 | unsigned long pflag = 0; | 1171 | unsigned long pflag = 0; |
1172 | int found = 0; | 1172 | int found = 0; |
1173 | 1173 | ||
1174 | spin_lock_irqsave(&phba->scsi_buf_list_get_lock, gflag); | 1174 | spin_lock_irqsave(&phba->scsi_buf_list_get_lock, gflag); |
1175 | list_for_each_entry(lpfc_cmd, &phba->lpfc_scsi_buf_list_get, list) { | 1175 | list_for_each_entry_safe(lpfc_cmd, lpfc_cmd_next, |
1176 | &phba->lpfc_scsi_buf_list_get, list) { | ||
1176 | if (lpfc_test_rrq_active(phba, ndlp, | 1177 | if (lpfc_test_rrq_active(phba, ndlp, |
1177 | lpfc_cmd->cur_iocbq.sli4_lxritag)) | 1178 | lpfc_cmd->cur_iocbq.sli4_lxritag)) |
1178 | continue; | 1179 | continue; |
@@ -1186,8 +1187,8 @@ lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) | |||
1186 | &phba->lpfc_scsi_buf_list_get); | 1187 | &phba->lpfc_scsi_buf_list_get); |
1187 | INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list_put); | 1188 | INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list_put); |
1188 | spin_unlock_irqrestore(&phba->scsi_buf_list_put_lock, pflag); | 1189 | spin_unlock_irqrestore(&phba->scsi_buf_list_put_lock, pflag); |
1189 | list_for_each_entry(lpfc_cmd, &phba->lpfc_scsi_buf_list_get, | 1190 | list_for_each_entry_safe(lpfc_cmd, lpfc_cmd_next, |
1190 | list) { | 1191 | &phba->lpfc_scsi_buf_list_get, list) { |
1191 | if (lpfc_test_rrq_active( | 1192 | if (lpfc_test_rrq_active( |
1192 | phba, ndlp, lpfc_cmd->cur_iocbq.sli4_lxritag)) | 1193 | phba, ndlp, lpfc_cmd->cur_iocbq.sli4_lxritag)) |
1193 | continue; | 1194 | continue; |