From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/scsi/lpfc/lpfc_scsi.c:4064 lpfc_fcp_io_cmd_wqe_cmpl() error: we previously assumed 'phba' could be null (see line 4060)
Date: Sun, 17 Jan 2021 11:35:12 +0800 [thread overview]
Message-ID: <202101171109.SCAXY4Xh-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6403 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: James Smart <james.smart@broadcom.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: Dick Kennedy <dick.kennedy@broadcom.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0da0a8a0a0e1845f495431c3d8d733d2bbf9e9e5
commit: 96e209be6ecb7b96dfb56f2737401adce33aef8e scsi: lpfc: Convert SCSI I/O completions to SLI-3 and SLI-4 handlers
date: 9 weeks ago
:::::: branch date: 7 hours ago
:::::: commit date: 9 weeks ago
config: x86_64-randconfig-m001-20210117 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
drivers/scsi/lpfc/lpfc_scsi.c:4064 lpfc_fcp_io_cmd_wqe_cmpl() error: we previously assumed 'phba' could be null (see line 4060)
Old smatch warnings:
drivers/scsi/lpfc/lpfc_scsi.c:4036 lpfc_fcp_io_cmd_wqe_cmpl() warn: variable dereferenced before check 'lpfc_cmd' (see line 4025)
vim +/phba +4064 drivers/scsi/lpfc/lpfc_scsi.c
96e209be6ecb7b96 James Smart 2020-11-15 4007
96e209be6ecb7b96 James Smart 2020-11-15 4008 /**
96e209be6ecb7b96 James Smart 2020-11-15 4009 * lpfc_fcp_io_cmd_wqe_cmpl - Complete a FCP IO
96e209be6ecb7b96 James Smart 2020-11-15 4010 * @phba: The hba for which this call is being executed.
96e209be6ecb7b96 James Smart 2020-11-15 4011 * @pwqeIn: The command WQE for the scsi cmnd.
96e209be6ecb7b96 James Smart 2020-11-15 4012 * @pwqeOut: The response WQE for the scsi cmnd.
96e209be6ecb7b96 James Smart 2020-11-15 4013 *
96e209be6ecb7b96 James Smart 2020-11-15 4014 * This routine assigns scsi command result by looking into response WQE
96e209be6ecb7b96 James Smart 2020-11-15 4015 * status field appropriately. This routine handles QUEUE FULL condition as
96e209be6ecb7b96 James Smart 2020-11-15 4016 * well by ramping down device queue depth.
96e209be6ecb7b96 James Smart 2020-11-15 4017 **/
96e209be6ecb7b96 James Smart 2020-11-15 4018 static void
96e209be6ecb7b96 James Smart 2020-11-15 4019 lpfc_fcp_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
96e209be6ecb7b96 James Smart 2020-11-15 4020 struct lpfc_wcqe_complete *wcqe)
96e209be6ecb7b96 James Smart 2020-11-15 4021 {
96e209be6ecb7b96 James Smart 2020-11-15 4022 struct lpfc_io_buf *lpfc_cmd =
96e209be6ecb7b96 James Smart 2020-11-15 4023 (struct lpfc_io_buf *)pwqeIn->context1;
96e209be6ecb7b96 James Smart 2020-11-15 4024 struct lpfc_vport *vport = pwqeIn->vport;
96e209be6ecb7b96 James Smart 2020-11-15 4025 struct lpfc_rport_data *rdata = lpfc_cmd->rdata;
96e209be6ecb7b96 James Smart 2020-11-15 4026 struct lpfc_nodelist *ndlp = rdata->pnode;
96e209be6ecb7b96 James Smart 2020-11-15 4027 struct scsi_cmnd *cmd;
96e209be6ecb7b96 James Smart 2020-11-15 4028 unsigned long flags;
96e209be6ecb7b96 James Smart 2020-11-15 4029 struct lpfc_fast_path_event *fast_path_evt;
96e209be6ecb7b96 James Smart 2020-11-15 4030 struct Scsi_Host *shost;
96e209be6ecb7b96 James Smart 2020-11-15 4031 u32 logit = LOG_FCP;
96e209be6ecb7b96 James Smart 2020-11-15 4032 u32 status, idx;
96e209be6ecb7b96 James Smart 2020-11-15 4033 unsigned long iflags = 0;
96e209be6ecb7b96 James Smart 2020-11-15 4034
96e209be6ecb7b96 James Smart 2020-11-15 4035 /* Sanity check on return of outstanding command */
96e209be6ecb7b96 James Smart 2020-11-15 4036 if (!lpfc_cmd) {
96e209be6ecb7b96 James Smart 2020-11-15 4037 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
96e209be6ecb7b96 James Smart 2020-11-15 4038 "9032 Null lpfc_cmd pointer. No "
96e209be6ecb7b96 James Smart 2020-11-15 4039 "release, skip completion\n");
96e209be6ecb7b96 James Smart 2020-11-15 4040 return;
96e209be6ecb7b96 James Smart 2020-11-15 4041 }
96e209be6ecb7b96 James Smart 2020-11-15 4042
96e209be6ecb7b96 James Smart 2020-11-15 4043 if (bf_get(lpfc_wcqe_c_xb, wcqe)) {
96e209be6ecb7b96 James Smart 2020-11-15 4044 /* TOREMOVE - currently this flag is checked during
96e209be6ecb7b96 James Smart 2020-11-15 4045 * the release of lpfc_iocbq. Remove once we move
96e209be6ecb7b96 James Smart 2020-11-15 4046 * to lpfc_wqe_job construct.
96e209be6ecb7b96 James Smart 2020-11-15 4047 *
96e209be6ecb7b96 James Smart 2020-11-15 4048 * This needs to be done outside buf_lock
96e209be6ecb7b96 James Smart 2020-11-15 4049 */
96e209be6ecb7b96 James Smart 2020-11-15 4050 spin_lock_irqsave(&phba->hbalock, iflags);
96e209be6ecb7b96 James Smart 2020-11-15 4051 lpfc_cmd->cur_iocbq.iocb_flag |= LPFC_EXCHANGE_BUSY;
96e209be6ecb7b96 James Smart 2020-11-15 4052 spin_unlock_irqrestore(&phba->hbalock, iflags);
96e209be6ecb7b96 James Smart 2020-11-15 4053 }
96e209be6ecb7b96 James Smart 2020-11-15 4054
96e209be6ecb7b96 James Smart 2020-11-15 4055 /* Guard against abort handler being called at same time */
96e209be6ecb7b96 James Smart 2020-11-15 4056 spin_lock(&lpfc_cmd->buf_lock);
96e209be6ecb7b96 James Smart 2020-11-15 4057
96e209be6ecb7b96 James Smart 2020-11-15 4058 /* Sanity check on return of outstanding command */
96e209be6ecb7b96 James Smart 2020-11-15 4059 cmd = lpfc_cmd->pCmd;
96e209be6ecb7b96 James Smart 2020-11-15 @4060 if (!cmd || !phba) {
96e209be6ecb7b96 James Smart 2020-11-15 4061 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
96e209be6ecb7b96 James Smart 2020-11-15 4062 "9042 I/O completion: Not an active IO\n");
96e209be6ecb7b96 James Smart 2020-11-15 4063 spin_unlock(&lpfc_cmd->buf_lock);
96e209be6ecb7b96 James Smart 2020-11-15 @4064 lpfc_release_scsi_buf(phba, lpfc_cmd);
96e209be6ecb7b96 James Smart 2020-11-15 4065 return;
96e209be6ecb7b96 James Smart 2020-11-15 4066 }
96e209be6ecb7b96 James Smart 2020-11-15 4067 idx = lpfc_cmd->cur_iocbq.hba_wqidx;
96e209be6ecb7b96 James Smart 2020-11-15 4068 if (phba->sli4_hba.hdwq)
96e209be6ecb7b96 James Smart 2020-11-15 4069 phba->sli4_hba.hdwq[idx].scsi_cstat.io_cmpls++;
96e209be6ecb7b96 James Smart 2020-11-15 4070
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 32987 bytes --]
reply other threads:[~2021-01-17 3:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202101171109.SCAXY4Xh-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.