From 31979008fdae72d7441643f3a5b1bdaedf481335 Mon Sep 17 00:00:00 2001 From: Johannes Thumshirn Date: Mon, 18 Jul 2016 16:06:03 +0200 Subject: lpfc: call lpfc_sli_validate_fcp_iocb() with the hbalock held Call lpfc_sli_validate_fcp_iocb() with the hbalock held, as the pointer to iocbq is not guaranteed to still be valid after looking it up. Signed-off-by: Johannes Thumshirn Reviewed-by: Laurence Oberman Acked-by: James Smart Signed-off-by: Martin K. Petersen --- drivers/scsi/lpfc/lpfc_sli.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/scsi/lpfc/lpfc_sli.c') diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index c8fd0a349eba..351d08ace24a 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -10203,6 +10203,7 @@ lpfc_sli_sum_iocb(struct lpfc_vport *vport, uint16_t tgt_id, uint64_t lun_id, struct lpfc_iocbq *iocbq; int sum, i; + spin_lock_irq(&phba->hbalock); for (i = 1, sum = 0; i <= phba->sli.last_iotag; i++) { iocbq = phba->sli.iocbq_lookup[i]; @@ -10210,6 +10211,7 @@ lpfc_sli_sum_iocb(struct lpfc_vport *vport, uint16_t tgt_id, uint64_t lun_id, ctx_cmd) == 0) sum++; } + spin_unlock_irq(&phba->hbalock); return sum; } -- cgit v1.2.3