From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@01.org
Cc: James.Bottomley@HansenPartnership.com, hmadhani@marvell.com,
kbuild-all@01.org, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 2/3] qla2xxx: on session delete return nvme cmd
Date: Wed, 26 Jun 2019 09:20:22 +0300 [thread overview]
Message-ID: <20190626062022.GB18776@kadam> (raw)
In-Reply-To: <20190618181021.16547-3-hmadhani@marvell.com>
Hi Himanshu,
url: https://github.com/0day-ci/linux/commits/Himanshu-Madhani/qla2xxx-Fix-crashes-with-FC-NVMe-devices/20190619-074559
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
drivers/scsi/qla2xxx/qla_nvme.c:245 qla_nvme_ls_req() warn: variable dereferenced before check 'fcport' (see line 242)
drivers/scsi/qla2xxx/qla_nvme.c:496 qla_nvme_post_cmd() warn: variable dereferenced before check 'fcport' (see line 494)
drivers/scsi/qla2xxx/qla_nvme.c:510 qla_nvme_post_cmd() error: we previously assumed 'qpair' could be null (see line 496)
Old smatch warnings:
drivers/scsi/qla2xxx/qla_nvme.c:190 qla_nvme_abort_work() warn: variable dereferenced before check 'fcport' (see line 183)
# https://github.com/0day-ci/linux/commit/69efeca5ca5e394664f54ef8e349a31b0f424507
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 69efeca5ca5e394664f54ef8e349a31b0f424507
vim +/fcport +245 drivers/scsi/qla2xxx/qla_nvme.c
e84067d7 Duane Grigsby 2017-06-21 230 static int qla_nvme_ls_req(struct nvme_fc_local_port *lport,
e84067d7 Duane Grigsby 2017-06-21 231 struct nvme_fc_remote_port *rport, struct nvmefc_ls_req *fd)
e84067d7 Duane Grigsby 2017-06-21 232 {
9dd9686b Darren Trapp 2018-03-20 233 struct qla_nvme_rport *qla_rport = rport->private;
9dd9686b Darren Trapp 2018-03-20 234 fc_port_t *fcport = qla_rport->fcport;
e84067d7 Duane Grigsby 2017-06-21 235 struct srb_iocb *nvme;
e84067d7 Duane Grigsby 2017-06-21 236 struct nvme_private *priv = fd->private;
e84067d7 Duane Grigsby 2017-06-21 237 struct scsi_qla_host *vha;
e84067d7 Duane Grigsby 2017-06-21 238 int rval = QLA_FUNCTION_FAILED;
e84067d7 Duane Grigsby 2017-06-21 239 struct qla_hw_data *ha;
e84067d7 Duane Grigsby 2017-06-21 240 srb_t *sp;
e84067d7 Duane Grigsby 2017-06-21 241
e84067d7 Duane Grigsby 2017-06-21 @242 vha = fcport->vha;
^^^^^^^^^^^
Dereference.
e84067d7 Duane Grigsby 2017-06-21 243 ha = vha->hw;
69efeca5 Quinn Tran 2019-06-18 244
69efeca5 Quinn Tran 2019-06-18 @245 if (!ha->flags.fw_started || (fcport && fcport->deleted))
^^^^^^
Check for NULL is too late.
69efeca5 Quinn Tran 2019-06-18 246 return rval;
69efeca5 Quinn Tran 2019-06-18 247
e84067d7 Duane Grigsby 2017-06-21 248 /* Alloc SRB structure */
e84067d7 Duane Grigsby 2017-06-21 249 sp = qla2x00_get_sp(vha, fcport, GFP_ATOMIC);
e84067d7 Duane Grigsby 2017-06-21 250 if (!sp)
e84067d7 Duane Grigsby 2017-06-21 251 return rval;
e84067d7 Duane Grigsby 2017-06-21 252
e84067d7 Duane Grigsby 2017-06-21 253 sp->type = SRB_NVME_LS;
parent reply other threads:[~2019-06-26 6:20 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20190618181021.16547-3-hmadhani@marvell.com>]
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=20190626062022.GB18776@kadam \
--to=dan.carpenter@oracle.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=hmadhani@marvell.com \
--cc=kbuild-all@01.org \
--cc=kbuild@01.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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