Hello James Smart,

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

The patch 2d7dbc4c2775: "scsi: lpfc: NVME Target: Receive buffer 
updates" from Feb 12, 2017, leads to the following Smatch complaint:

drivers/scsi/lpfc/lpfc_sli.c:15194 lpfc_mrq_create()
         warn: variable dereferenced before check 'hrq' (see line 15188)

drivers/scsi/lpfc/lpfc_sli.c
 15181          cnt = 0;
 15182  
 15183          for (idx = 0; idx < numrq; idx++) {
 15184                  hrq = hrqp[idx];
 15185                  drq = drqp[idx];
 15186                  cq  = cqp[idx];
 15187  
 15188                  if (hrq->entry_count != drq->entry_count) {
                            ^^^^^^^^^^^^^^^^    ^^^^^^^^^^^^^^^^
Dereferences.

 15189                          status = -EINVAL;
 15190                          goto out;
 15191                  }
 15192  
 15193                  /* sanity check on queue memory */
 15194                  if (!hrq || !drq || !cq) {
                             ^^^^^^^^^^^
Too late.

 15195                          status = -ENODEV;
 15196                          goto out;

regards,
dan carpenter

Reply via email to