Commit 6b6eaf8a authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: Fix lpfc_els_retry() possible null pointer dereference

Driver crashed in lpfc_debugfs_disc_trc() due to null ndlp pointer.  In
some calling cases, the ndlp is null and the did is looked up.

Fix by using the local did variable that is set appropriately based on ndlp
value.

Link: https://lore.kernel.org/r/20210301171821.3427-7-jsmart2021@gmail.comCo-developed-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 618e2ee1
...@@ -3823,7 +3823,7 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -3823,7 +3823,7 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD,
"Retry ELS: wd7:x%x wd4:x%x did:x%x", "Retry ELS: wd7:x%x wd4:x%x did:x%x",
*(((uint32_t *) irsp) + 7), irsp->un.ulpWord[4], ndlp->nlp_DID); *(((uint32_t *)irsp) + 7), irsp->un.ulpWord[4], did);
switch (irsp->ulpStatus) { switch (irsp->ulpStatus) {
case IOSTAT_FCP_RSP_ERROR: case IOSTAT_FCP_RSP_ERROR:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment