[PATCH 02/17] lpfc: NVME Initiator: Base modifications Part A

Johannes Thumshirn jthumshirn at suse.de
Thu Jan 19 00:04:36 PST 2017


On Wed, Jan 18, 2017 at 06:34:02PM -0800, James Smart wrote:
> 
> 
> On 1/18/2017 1:50 AM, Johannes Thumshirn wrote:
> 
> >>@@ -4959,11 +4968,11 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct scsi_cmnd *cmnd,
> >>  	int status;
> >>  	rdata = lpfc_rport_data_from_scsi_device(cmnd->device);
> >>-	if (!rdata || !rdata->pnode || !NLP_CHK_NODE_ACT(rdata->pnode))
> >>-		return FAILED;
> >OK, I don't get this hunk. lpfc_rport_data_from_scsi_device() cannot return
> >NULL anymore?
> >
> >I at least expected something like:
> >
> >   	rdata = lpfc_rport_data_from_scsi_device(cmnd->device);
> >	if (!rdata || !rdata->pnode)
> >		return FAILED;
> >	
> >	pnode = rdata->pnode;
> >	if (!NLP_CHK_NODE_ACT(pnode)
> >		return FAILED;
> 
> it can and the order of precedence for the if check allows for it. I don't
> see any difference in what you wrote vs what's there, other than pnode gets
> an assignment.

You're doing:
rdata = lpfc_rport_data_from_scsi_device(cmnd->device);
pnode = rdata->pnode;
if (!pnode || !NLP_CHK_NODE_ACT(pnode)) 
	return FAILED;

So if rdata is already NULL, the pnode = rdata->pnode line will blow up.

-- 
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850



More information about the Linux-nvme mailing list