[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160705123839.icbrfwyru4z3gc67@c203.arch.suse.de>
Date: Tue, 5 Jul 2016 14:38:39 +0200
From: Johannes Thumshirn <jthumshirn@...e.de>
To: Tyrel Datwyler <turtle.in.the.kernel@...il.com>
Cc: "Martin K . Petersen" <martin.petersen@...cle.com>,
James Bottomley <jejb@...ux.vnet.ibm.com>,
James Smart <james.smart@...gotech.com>,
Dick Kennedy <dick.kennedy@...gotech.com>,
Linux SCSI Mailinglist <linux-scsi@...r.kernel.org>,
Linux Kernel Mailinglist <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] lpfc: Fix possible NULL pointer dereference
On Tue, Jun 28, 2016 at 01:28:19PM -0700, Tyrel Datwyler wrote:
> On 06/15/2016 06:00 AM, Johannes Thumshirn wrote:
> > Check for the existance of pciob->vport before accessing it.
>
> piocb mispelled.
Oops
>
> >
> > Signed-off-by: Johannes Thumshirn <jthumshirn@...e.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?
Yes, you're right. Let me see how to solve it _and_ make the statement a bit
more readable.
Thanks,
Johannes
--
Johannes Thumshirn Storage
jthumshirn@...e.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
Powered by blists - more mailing lists