[bug report] scsi: lpfc: Fix handling of FCP and NVME FC4 types in Pt2Pt topology

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

 



Hello Dick Kennedy,

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

The patch 8fd5f79a9cf4: "scsi: lpfc: Fix handling of FCP and NVME FC4 
types in Pt2Pt topology" from Aug 23, 2017, leads to the following 
Smatch complaint:

drivers/scsi/lpfc/lpfc_els.c:2010 lpfc_issue_els_plogi()
	 error: we previously assumed 'ndlp' could be null (see line 1998)

drivers/scsi/lpfc/lpfc_els.c
  1997		ndlp = lpfc_findnode_did(vport, did);
  1998		if (ndlp && !NLP_CHK_NODE_ACT(ndlp))
  1999			ndlp = NULL;
                        ^^^^^^^^^^^
ndlp can be NULL.

  2000	
  2001		/* If ndlp is not NULL, we will bump the reference count on it */
  2002		cmdsize = (sizeof(uint32_t) + sizeof(struct serv_parm));
  2003		elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, did,
  2004					     ELS_CMD_PLOGI);
  2005		if (!elsiocb)
  2006			return 1;
  2007	
  2008		shost = lpfc_shost_from_vport(vport);
  2009		spin_lock_irq(shost->host_lock);
  2010		ndlp->nlp_flag &= ~NLP_FCP_PRLI_RJT;
                ^^^^^^^^^^^^^^
We added a new unchecked dereference.

  2011		spin_unlock_irq(shost->host_lock);
  2012	

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