Skip to contentSkip to conversation

scsi: lpfc: NVME Target: Receive buffer updates

bug report Dan Carpenter 2 participants 2 messages Feb 27, 2017 – Mar 4, 2017 SCSI

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 8 lines · Dan Carpenter

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:

Thanks. Issues were addressed by patch from Colin King, and pushed in the lpfc patch set just posted. see http://marc.info/?l=linux-scsi&m=148864866515100&w=2

-- james