All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] scsi: lpfc: Add registration for CPU Offline/Online events
@ 2019-11-08  5:17 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2019-11-08  5:17 UTC (permalink / raw)
  To: jsmart2021; +Cc: linux-scsi

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-08  5:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08  5:17 [bug report] scsi: lpfc: Add registration for CPU Offline/Online events Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.