Skip to contentSkip to conversation

lpfc 8.3.29: T10 Diff fixes and enhancements

SCSI Dan Carpenter 1 participant 1 message Feb 20, 2012 SCSI

lore
Share & tools
lore
#0 lore raw

Hello James Smart,

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

The patch acd6859b084d: "[SCSI] lpfc 8.3.29: T10 Diff fixes and enhancements" from Jan 18, 2012, leads to the following Smatch complaint:

drivers/scsi/lpfc/lpfc_scsi.c:1592 lpfc_bg_err_inject()
error: we previously assumed 'apptag' could be null (see line 1430)

drivers/scsi/lpfc/lpfc_scsi.c
1429 /* Should we change the Application Tag */

  1430		if (apptag) {
                    ^^^^^^

Old check.

  1431			if (phba->lpfc_injerr_wapp_cnt) {
  1432				switch (op) {
  1433				case SCSI_PROT_WRITE_PASS:
  1434					if (blockoff && src) {

[snip]

1585 case SCSI_PROT_READ_STRIP:
1586 case SCSI_PROT_READ_PASS:
1587 /*
1588 * For READ_STRIP and READ_PASS, force the
1589 * error on data being read off the wire. It
1590 * should force an IO error to the driver.
1591 */

  1592					*apptag = 0xDEAD;
                                        ^^^^^^^

New dereference not checked. Btw, apptag is always zero in the current code.

  1593					phba->lpfc_injerr_rgrd_cnt--;
  1594					phba->lpfc_injerr_lba = LPFC_INJERR_LBA_OFF;

regards,
dan carpenter