Hello Himanshu Madhani,
This is a semi-automatic email about new static checker warnings.
The patch 395cb345b964: "scsi: qla2xxx: Check for FW started flag
before aborting" from Feb 15, 2019, leads to the following Smatch
complaint:
drivers/scsi/qla2xxx/qla_nvme.c:188 qla_nvme_abort_work()
warn: variable dereferenced before check 'fcport' (see line 185)
drivers/scsi/qla2xxx/qla_nvme.c
184 fc_port_t *fcport = sp->fcport;
185 struct qla_hw_data *ha = fcport->vha->hw;
^^^^^^^^^^^^^^^
Deferenced.
186 int rval;
187
188 if (fcport)
^^^^^^
189 ql_dbg(ql_dbg_io, fcport->vha, 0xffff,
190 "%s called for sp=%p, hndl=%x on fcport=%p
deleted=%d\n",
191 __func__, sp, sp->handle, fcport, fcport->deleted);
192
193 if (!ha->flags.fw_started && (fcport && fcport->deleted))
^^^^^^
New checks added too late.
194 return;
195
196 rval = ha->isp_ops->abort_command(sp);
197
198 ql_dbg(ql_dbg_io, fcport->vha, 0x212b,
199 "%s: %s command for sp=%p, handle=%x on fcport=%p
rval=%x\n",
200 __func__, (rval != QLA_SUCCESS) ? "Failed to abort" :
"Aborted",
201 sp, sp->handle, fcport, rval);
202 }
regards,
dan carpenter