]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
lpfc: call lpfc_sli_validate_fcp_iocb() with the hbalock held
authorJohannes Thumshirn <jthumshirn@suse.de>
Mon, 18 Jul 2016 14:06:03 +0000 (16:06 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 27 Feb 2017 06:13:09 +0000 (22:13 -0800)
Orabug: 25486030

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 <jthumshirn@suse.de>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 31979008fdae72d7441643f3a5b1bdaedf481335)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/scsi/lpfc/lpfc_sli.c

index 98fb307ab7273cafd822467c4001228314d34ad0..ef56fb1b71c980da362bca327f4381f28dfd5968 100644 (file)
@@ -10170,6 +10170,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];
 
@@ -10177,6 +10178,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;
 }