public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: jsmart2021@gmail.com
Cc: linux-scsi@vger.kernel.org
Subject: [bug report] scsi: lpfc: NVME Initiator: Merge into FC discovery
Date: Mon, 27 Feb 2017 19:34:29 +0300	[thread overview]
Message-ID: <20170227163429.GA30640@mwanda> (raw)

Hello James Smart,

This is a semi-automatic email about new static checker warnings.

The patch a0f2d3ef374f: "scsi: lpfc: NVME Initiator: Merge into FC 
discovery" from Feb 12, 2017, leads to the following Smatch complaint:

drivers/scsi/lpfc/lpfc_ct.c:943 lpfc_cmpl_ct_cmd_gft_id()
	 error: we previously assumed 'ndlp' could be null (see line 928)

drivers/scsi/lpfc/lpfc_ct.c
   927			ndlp = lpfc_findnode_did(vport, did);
   928			if (ndlp) {
                            ^^^^
Check.

   929				/* The bitmask value for FCP and NVME FCP types is
   930				 * the same because they are 32 bits distant from
   931				 * each other in word0 and word0.
   932				 */
   933				if (fc4_data_0 & LPFC_FC4_TYPE_BITMASK)
   934					ndlp->nlp_fc4_type |= NLP_FC4_FCP;
   935				if (fc4_data_1 &  LPFC_FC4_TYPE_BITMASK)
   936					ndlp->nlp_fc4_type |= NLP_FC4_NVME;
   937				lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
   938						 "3064 Setting ndlp %p, DID x%06x with "
   939						 "FC4 x%08x, Data: x%08x x%08x\n",
   940						 ndlp, did, ndlp->nlp_fc4_type,
   941						 FC_TYPE_FCP, FC_TYPE_NVME);
   942			}
   943			ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE;
                        ^^^^^^^^^^^^^^^^^^^^
Not checked.

   944			lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE);
   945			lpfc_issue_els_prli(vport, ndlp, 0);

	drivers/scsi/lpfc/lpfc_nvmet.c:1694 lpfc_nvmet_unsol_issue_abort()
	error: we previously assumed 'ndlp' could be null (see line 1690)

drivers/scsi/lpfc/lpfc_nvmet.c
  1688  
  1689          ndlp = lpfc_findnode_did(phba->pport, sid);
  1690          if (!ndlp || !NLP_CHK_NODE_ACT(ndlp) ||
                    ^^^^^
Check.

  1691              ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
  1692              (ndlp->nlp_state != NLP_STE_MAPPED_NODE))) {
  1693                  atomic_inc(&tgtp->xmt_abort_rsp_error);
  1694                  lpfc_printf_log(phba, KERN_WARNING, LOG_NVME_ABTS,
  1695                                  "6134 Drop ABTS - wrong NDLP state x%x.\n",
  1696                                  ndlp->nlp_state);
                                        ^^^^^^^^^^^^^^^
Potential Oops.

  1697  
  1698                  /* No failure to an ABTS request. */
  1699                  return 0;
  1700          }

	drivers/scsi/lpfc/lpfc_nvmet.c:1792 lpfc_nvmet_sol_fcp_issue_abort()
	error: we previously assumed 'ndlp' could be null (see line 1788)

drivers/scsi/lpfc/lpfc_nvmet.c
  1786  
  1787          ndlp = lpfc_findnode_did(phba->pport, sid);
  1788          if (!ndlp || !NLP_CHK_NODE_ACT(ndlp) ||
                    ^^^^^
Check.

  1789              ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
  1790              (ndlp->nlp_state != NLP_STE_MAPPED_NODE))) {
  1791                  atomic_inc(&tgtp->xmt_abort_rsp_error);
  1792                  lpfc_printf_log(phba, KERN_WARNING, LOG_NVME_ABTS,
  1793                                  "6160 Drop ABTS - wrong NDLP state x%x.\n",
  1794                                  ndlp->nlp_state);
                                        ^^^^^^^^^^^^^^^
Potential Oops.

  1795  
  1796                  /* No failure to an ABTS request. */
  1797                  return 0;
  1798          }

regards,
dan carpenter

             reply	other threads:[~2017-02-27 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 16:34 Dan Carpenter [this message]
2017-03-04 17:48 ` [bug report] scsi: lpfc: NVME Initiator: Merge into FC discovery James Smart
  -- strict thread matches above, loose matches on Subject: below --
2017-05-03 21:21 Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170227163429.GA30640@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=jsmart2021@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox