diff options
author | James Smart <jsmart2021@gmail.com> | 2017-03-04 12:30:39 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-03-06 23:04:23 -0500 |
commit | b5ccc7d61c76006f839b41c6f15876342b46cb02 (patch) | |
tree | baf5ab13c443e3470412c8d4f0fa110b3310159e | |
parent | 2ade92ae6d6572858acb2bde6d3664af3ad592e2 (diff) |
scsi: lpfc: code cleanups in NVME initiator discovery
This patch addresses the smatch issues identified by Dan Carpenter
in http://www.spinics.net/lists/linux-scsi/msg105665.html
The issues are:
drivers/scsi/lpfc/lpfc_ct.c:943 lpfc_cmpl_ct_cmd_gft_id()
error: we previously assumed 'ndlp' could be null (see line 928)
Action: moved under if check
drivers/scsi/lpfc/lpfc_nvmet.c:1694 lpfc_nvmet_unsol_issue_abort()
error: we previously assumed 'ndlp' could be null (see line 1690)
Action: conditionalized arg in printf stmt
drivers/scsi/lpfc/lpfc_nvmet.c:1792 lpfc_nvmet_sol_fcp_issue_abort()
error: we previously assumed 'ndlp' could be null (see line 1788)
Action: conditionalized arg in printf stmt
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-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 | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_nvmet.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index c22bb3f887e1..d3e9af983015 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c | |||
@@ -939,8 +939,8 @@ lpfc_cmpl_ct_cmd_gft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, | |||
939 | "FC4 x%08x, Data: x%08x x%08x\n", | 939 | "FC4 x%08x, Data: x%08x x%08x\n", |
940 | ndlp, did, ndlp->nlp_fc4_type, | 940 | ndlp, did, ndlp->nlp_fc4_type, |
941 | FC_TYPE_FCP, FC_TYPE_NVME); | 941 | FC_TYPE_FCP, FC_TYPE_NVME); |
942 | ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; | ||
942 | } | 943 | } |
943 | ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; | ||
944 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); | 944 | lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); |
945 | lpfc_issue_els_prli(vport, ndlp, 0); | 945 | lpfc_issue_els_prli(vport, ndlp, 0); |
946 | } else | 946 | } else |
diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c index a69ca6ea1d6c..b7739a554fe0 100644 --- a/drivers/scsi/lpfc/lpfc_nvmet.c +++ b/drivers/scsi/lpfc/lpfc_nvmet.c | |||
@@ -1720,7 +1720,7 @@ lpfc_nvmet_unsol_issue_abort(struct lpfc_hba *phba, | |||
1720 | atomic_inc(&tgtp->xmt_abort_rsp_error); | 1720 | atomic_inc(&tgtp->xmt_abort_rsp_error); |
1721 | lpfc_printf_log(phba, KERN_WARNING, LOG_NVME_ABTS, | 1721 | lpfc_printf_log(phba, KERN_WARNING, LOG_NVME_ABTS, |
1722 | "6134 Drop ABTS - wrong NDLP state x%x.\n", | 1722 | "6134 Drop ABTS - wrong NDLP state x%x.\n", |
1723 | ndlp->nlp_state); | 1723 | (ndlp) ? ndlp->nlp_state : NLP_STE_MAX_STATE); |
1724 | 1724 | ||
1725 | /* No failure to an ABTS request. */ | 1725 | /* No failure to an ABTS request. */ |
1726 | return 0; | 1726 | return 0; |
@@ -1818,7 +1818,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lpfc_hba *phba, | |||
1818 | atomic_inc(&tgtp->xmt_abort_rsp_error); | 1818 | atomic_inc(&tgtp->xmt_abort_rsp_error); |
1819 | lpfc_printf_log(phba, KERN_WARNING, LOG_NVME_ABTS, | 1819 | lpfc_printf_log(phba, KERN_WARNING, LOG_NVME_ABTS, |
1820 | "6160 Drop ABTS - wrong NDLP state x%x.\n", | 1820 | "6160 Drop ABTS - wrong NDLP state x%x.\n", |
1821 | ndlp->nlp_state); | 1821 | (ndlp) ? ndlp->nlp_state : NLP_STE_MAX_STATE); |
1822 | 1822 | ||
1823 | /* No failure to an ABTS request. */ | 1823 | /* No failure to an ABTS request. */ |
1824 | return 0; | 1824 | return 0; |