diff options
author | James Smart <jsmart2021@gmail.com> | 2017-05-15 15:20:39 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-05-16 21:17:54 -0400 |
commit | 0c9c6a75141810acade82add4f4708959a5d3a1d (patch) | |
tree | 5a0490280fde16d0cde18363d9bf4fadf97fd90c /drivers/scsi/lpfc/lpfc.h | |
parent | 845d9e8df2fa879e6494e786f290e1fd5560ac8c (diff) | |
download | lwn-0c9c6a75141810acade82add4f4708959a5d3a1d.tar.gz lwn-0c9c6a75141810acade82add4f4708959a5d3a1d.zip |
scsi: lpfc: Fix system crash when port is reset.
The driver panic when using the els_wq during port reset.
Check for NULL els_wq before dereferencing.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc.h')
-rw-r--r-- | drivers/scsi/lpfc/lpfc.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 6d7840b096e6..62571fa9c6ad 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -1228,7 +1228,11 @@ lpfc_sli_read_hs(struct lpfc_hba *phba) static inline struct lpfc_sli_ring * lpfc_phba_elsring(struct lpfc_hba *phba) { - if (phba->sli_rev == LPFC_SLI_REV4) - return phba->sli4_hba.els_wq->pring; + if (phba->sli_rev == LPFC_SLI_REV4) { + if (phba->sli4_hba.els_wq) + return phba->sli4_hba.els_wq->pring; + else + return NULL; + } return &phba->sli.sli3_ring[LPFC_ELS_RING]; } |