[bug report] scsi: qla2xxx: Check for FW started flag before aborting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux