Hello James Smart,

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

The patch 6a828b0f6192: "scsi: lpfc: Support non-uniform allocation 
of MSIX vectors to hardware queues" from Jan 28, 2019, leads to the 
following Smatch complaint:

    drivers/scsi/lpfc/lpfc_scsi.c:3674 lpfc_scsi_cmd_iocb_cmpl()
    error: we previously assumed 'phba->sli4_hba.hdwq' could be null (see line 
3667)

drivers/scsi/lpfc/lpfc_scsi.c
  3666          idx = lpfc_cmd->cur_iocbq.hba_wqidx;
  3667          if (phba->sli4_hba.hdwq)
                    ^^^^^^^^^^^^^^^^^^^
Old code checks for NULL.

  3668                  phba->sli4_hba.hdwq[idx].scsi_cstat.io_cmpls++;
  3669  
  3670  #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
  3671          if (phba->cpucheck_on & LPFC_CHECK_SCSI_IO) {
  3672                  cpu = smp_processor_id();
  3673                  if (cpu < LPFC_CHECK_CPU_CNT)
  3674                          
phba->sli4_hba.hdwq[idx].cpucheck_cmpl_io[cpu]++;
                                ^^^^^^^^^^^^^^^^^^^^^^^^
New unchecked dereference.  Although possibly the LPFC_CHECK_SCSI_IO
condition implies it is non-NULL?

  3675          }
  3676  #endif

regards,
dan carpenter

Reply via email to