]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
scsi: lpfc: Fix issuing init_vpi mbox on SLI-3 card
authorJames Smart <jsmart2021@gmail.com>
Wed, 14 Aug 2019 23:56:40 +0000 (16:56 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 20 Aug 2019 02:41:09 +0000 (22:41 -0400)
The driver is inadvertently trying to issue an INIT_VPI mailbox command on
an SLI-3 driver. The command is specific to SLI-4. When the call is made to
send the command, if on an SLI-3 adapter, an array pointer is NULL and the
driver will oops.

Fix by restricting the command to SLI-4 adapters only.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_vport.c

index 343bc71d4615fc5ceb8218d9aabb52e4f96706a9..b7664635798006dd25881fdd751c320364ddcbdc 100644 (file)
@@ -527,9 +527,11 @@ disable_vport(struct fc_vport *fc_vport)
         * scsi_host_put() to release the vport.
         */
        lpfc_mbx_unreg_vpi(vport);
-       spin_lock_irq(shost->host_lock);
-       vport->fc_flag |= FC_VPORT_NEEDS_INIT_VPI;
-       spin_unlock_irq(shost->host_lock);
+       if (phba->sli_rev == LPFC_SLI_REV4) {
+               spin_lock_irq(shost->host_lock);
+               vport->fc_flag |= FC_VPORT_NEEDS_INIT_VPI;
+               spin_unlock_irq(shost->host_lock);
+       }
 
        lpfc_vport_set_state(vport, FC_VPORT_DISABLED);
        lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,