public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Smart <james.smart@broadcom.com>
To: SeongJae Park <sjpark@amazon.com>,
	jsmart2021@gmail.com, dick.kennedy@broadcom.com
Cc: jejb@linux.ibm.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	SeongJae Park <sjpark@amazon.de>
Subject: Re: [PATCH] scsi: lpfc: Avoid another null dereference in lpfc_sli4_hba_unset()
Date: Tue, 23 Jun 2020 13:23:17 -0700	[thread overview]
Message-ID: <470678bf-2e08-c75f-db14-7569cc4fe4c7@broadcom.com> (raw)
In-Reply-To: <20200623084122.30633-1-sjpark@amazon.com>



On 6/23/2020 1:41 AM, SeongJae Park wrote:
> From: SeongJae Park <sjpark@amazon.de>
>
> Commit cdb42becdd40 ("scsi: lpfc: Replace io_channels for nvme and fcp
> with general hdw_queues per cpu") has introduced static checker warnings
> for potential null dereferences in 'lpfc_sli4_hba_unset()' and
> commit 1ffdd2c0440d ("scsi: lpfc: resolve static checker warning in
> lpfc_sli4_hba_unset") has tried to fix it.  However, yet another
> potential null dereference is remaining.  This commit fixes it.
>
> This bug was discovered and resolved using Coverity Static Analysis
> Security Testing (SAST) by Synopsys, Inc.
>
> Fixes: 1ffdd2c0440d ("scsi: lpfc: resolve static checker warning inlpfc_sli4_hba_unset")
> Fixes: cdb42becdd40 ("scsi: lpfc: Replace io_channels for nvme and fcp with general hdw_queues per cpu")
> Signed-off-by: SeongJae Park <sjpark@amazon.de>
> ---
>   drivers/scsi/lpfc/lpfc_init.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index 69a5249e007a..6637f84a3d1b 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -11878,7 +11878,8 @@ lpfc_sli4_hba_unset(struct lpfc_hba *phba)
>   	lpfc_sli4_xri_exchange_busy_wait(phba);
>   
>   	/* per-phba callback de-registration for hotplug event */
> -	lpfc_cpuhp_remove(phba);
> +	if (phba->pport)
> +		lpfc_cpuhp_remove(phba);
>   
>   	/* Disable PCI subsystem interrupt */
>   	lpfc_sli4_disable_intr(phba);

Reviewed-by: James Smart <james.smart@broadcom.com>

-- james


  reply	other threads:[~2020-06-23 21:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23  8:41 [PATCH] scsi: lpfc: Avoid another null dereference in lpfc_sli4_hba_unset() SeongJae Park
2020-06-23 20:23 ` James Smart [this message]
2020-06-24  4:29 ` Martin K. Petersen

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=470678bf-2e08-c75f-db14-7569cc4fe4c7@broadcom.com \
    --to=james.smart@broadcom.com \
    --cc=dick.kennedy@broadcom.com \
    --cc=jejb@linux.ibm.com \
    --cc=jsmart2021@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sjpark@amazon.com \
    --cc=sjpark@amazon.de \
    /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