Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: James Smart <jsmart2021@gmail.com>
Cc: linux-nvme@lists.infradead.org, sagi@grimberg.me,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 02/17] lpfc: NVME Initiator: Base modifications Part A
Date: Thu, 19 Jan 2017 09:04:36 +0100	[thread overview]
Message-ID: <20170119080436.GB5054@linux-x5ow.site> (raw)
In-Reply-To: <af9d3d56-2239-232c-7317-7ae0ec25be90@gmail.com>

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@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

  reply	other threads:[~2017-01-19  8:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-18  1:20 [PATCH 02/17] lpfc: NVME Initiator: Base modifications Part A James Smart
2017-01-18  7:07 ` Hannes Reinecke
2017-01-19  2:07   ` James Smart
2017-01-18  9:50 ` Johannes Thumshirn
2017-01-19  2:34   ` James Smart
2017-01-19  8:04     ` Johannes Thumshirn [this message]
2017-01-19 15:13       ` James Smart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170119080436.GB5054@linux-x5ow.site \
    --to=jthumshirn@suse.de \
    --cc=jsmart2021@gmail.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox