public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: jsmart2021@gmail.com
Cc: linux-scsi@vger.kernel.org
Subject: [bug report] scsi: lpfc: Add registration for CPU Offline/Online events
Date: Fri, 8 Nov 2019 08:17:38 +0300	[thread overview]
Message-ID: <20191108051738.GA27223@mwanda> (raw)

Hello James Smart,

This is a semi-automatic email about new static checker warnings.

The patch 93a4d6f40198: "scsi: lpfc: Add registration for CPU
Offline/Online events" from Nov 4, 2019, leads to the following
Smatch complaint:

    drivers/scsi/lpfc/lpfc_init.c:11873 lpfc_sli4_hba_unset()
    warn: variable dereferenced before check 'phba->pport' (see line 11844)

drivers/scsi/lpfc/lpfc_init.c
 11843		/* per-phba callback de-registration for hotplug event */
 11844		lpfc_cpuhp_remove(phba);
                                  ^^^^
New dereference of "phba->pport" inside this function.

 11845	
 11846		/* Disable PCI subsystem interrupt */
 11847		lpfc_sli4_disable_intr(phba);
 11848	
 11849		/* Disable SR-IOV if enabled */
 11850		if (phba->cfg_sriov_nr_virtfn)
 11851			pci_disable_sriov(pdev);
 11852	
 11853		/* Stop kthread signal shall trigger work_done one more time */
 11854		kthread_stop(phba->worker_thread);
 11855	
 11856		/* Disable FW logging to host memory */
 11857		lpfc_ras_stop_fwlog(phba);
 11858	
 11859		/* Unset the queues shared with the hardware then release all
 11860		 * allocated resources.
 11861		 */
 11862		lpfc_sli4_queue_unset(phba);
 11863		lpfc_sli4_queue_destroy(phba);
 11864	
 11865		/* Reset SLI4 HBA FCoE function */
 11866		lpfc_pci_function_reset(phba);
 11867	
 11868		/* Free RAS DMA memory */
 11869		if (phba->ras_fwlog.ras_enabled)
 11870			lpfc_sli4_ras_dma_free(phba);
 11871	
 11872		/* Stop the SLI4 device port */
 11873		if (phba->pport)
                    ^^^^^^^^^^^
The old code used to check for NULL.

 11874			phba->pport->work_port_events = 0;
 11875	}

regards,
dan carpenter

                 reply	other threads:[~2019-11-08  5:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20191108051738.GA27223@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=jsmart2021@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    /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