From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932443AbcG1O6u (ORCPT ); Thu, 28 Jul 2016 10:58:50 -0400 Received: from mail-qk0-f176.google.com ([209.85.220.176]:34201 "EHLO mail-qk0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932381AbcG1O6m (ORCPT ); Thu, 28 Jul 2016 10:58:42 -0400 Subject: Re: [PATCH] lpfc: Fix possible NULL pointer dereference To: Johannes Thumshirn , "Martin K . Petersen" , James Bottomley References: <1465995608-53252-1-git-send-email-jthumshirn@suse.de> Cc: James Smart , Dick Kennedy , Linux SCSI Mailinglist , Linux Kernel Mailinglist From: James Smart Message-ID: Date: Thu, 28 Jul 2016 07:58:38 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1465995608-53252-1-git-send-email-jthumshirn@suse.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch is good. Thanks -- james Signed-off-by: James Smart On 6/15/2016 6:00 AM, Johannes Thumshirn wrote: > Check for the existance of pciob->vport before accessing it. > > Signed-off-by: Johannes Thumshirn > --- > 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(); > - 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; > }