linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tyrel Datwyler <turtle.in.the.kernel@gmail.com>
To: Johannes Thumshirn <jthumshirn@suse.de>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	James Bottomley <jejb@linux.vnet.ibm.com>
Cc: James Smart <james.smart@avagotech.com>,
	Dick Kennedy <dick.kennedy@avagotech.com>,
	Linux SCSI Mailinglist <linux-scsi@vger.kernel.org>,
	Linux Kernel Mailinglist <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] lpfc: Fix possible NULL pointer dereference
Date: Tue, 28 Jun 2016 13:28:19 -0700	[thread overview]
Message-ID: <5772DDE3.30600@gmail.com> (raw)
In-Reply-To: <1465995608-53252-1-git-send-email-jthumshirn@suse.de>

On 06/15/2016 06:00 AM, Johannes Thumshirn wrote:
> Check for the existance of pciob->vport before accessing it.

piocb mispelled.

> 
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  drivers/scsi/lpfc/lpfc_sli.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index 70edf21..134078f 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -1329,15 +1329,10 @@ lpfc_sli_ringtxcmpl_put(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
>  	if ((unlikely(pring->ringno == LPFC_ELS_RING)) &&
>  	   (piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) &&
>  	   (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN) &&
> -	 (!(piocb->vport->load_flag & FC_UNLOADING))) {
> -		if (!piocb->vport)
> -			BUG();

Granted the previous code would crash and burn in the if statement prior
to the BUG() assertion if piocb->vport was NULL, but is the condition
!piocb->vport still a bug here? Should that case still be asserted?

-Tyrel

> -		else
> -			mod_timer(&piocb->vport->els_tmofunc,
> -				jiffies +
> -				msecs_to_jiffies(1000 * (phba->fc_ratov << 1)));
> -	}
> -
> +	    piocb->vport && !(piocb->vport->load_flag & FC_UNLOADING))
> +		mod_timer(&piocb->vport->els_tmofunc,
> +			  jiffies +
> +			  msecs_to_jiffies(1000 * (phba->fc_ratov << 1)));
>  
>  	return 0;
>  }
> 

  reply	other threads:[~2016-06-28 20:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15 13:00 [PATCH] lpfc: Fix possible NULL pointer dereference Johannes Thumshirn
2016-06-28 20:28 ` Tyrel Datwyler [this message]
2016-07-05 12:38   ` Johannes Thumshirn
2016-07-28 14:58 ` James Smart
2016-07-29  1:21   ` Martin K. Petersen
2016-07-29  8:06     ` Johannes Thumshirn

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=5772DDE3.30600@gmail.com \
    --to=turtle.in.the.kernel@gmail.com \
    --cc=dick.kennedy@avagotech.com \
    --cc=james.smart@avagotech.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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;
as well as URLs for NNTP newsgroup(s).