diff options
author | Gustavo A. R. Silva <garsilva@embeddedor.com> | 2017-05-23 11:09:28 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-05-31 22:45:15 -0400 |
commit | e6ef6a77f51e403a1400241b9d029ecaba45a834 (patch) | |
tree | 969e9aeda7900fd8b1060a91590e80d40e81f0e6 | |
parent | 7c9fdfb7000715df2d187df251d11e4850ce94c8 (diff) |
scsi: lpfc: prevent potential null pointer dereference
Null check at line 966: if (ndlp) {, implies that ndlp might be NULL.
Functions lpfc_nlp_set_state() and lpfc_issue_els_prli() dereference
pointer ndlp. Include these function calls inside the IF block that
tests pointer ndlp.
Addresses-Coverity-ID: 1401856
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/lpfc/lpfc_ct.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index f2cd19c6c2df..24ce96dcc94d 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c | |||
@@ -978,9 +978,10 @@ lpfc_cmpl_ct_cmd_gft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, | |||
978 | ndlp, did, ndlp->nlp_fc4_type, | 978 | ndlp, did, ndlp->nlp_fc4_type, |
979 | FC_TYPE_FCP, FC_TYPE_NVME); | 979 | FC_TYPE_FCP, FC_TYPE_NVME); |
980 | ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; | 980 | ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; |
981 | |||
982 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); | ||
983 | lpfc_issue_els_prli(vport, ndlp, 0); | ||
981 | } | 984 | } |
982 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); | ||
983 | lpfc_issue_els_prli(vport, ndlp, 0); | ||
984 | } else | 985 | } else |
985 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, | 986 | lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, |
986 | "3065 GFT_ID failed x%08x\n", irsp->ulpStatus); | 987 | "3065 GFT_ID failed x%08x\n", irsp->ulpStatus); |