linux/drivers/scsi/lpfc
Justin Tee c6c58505bf scsi: lpfc: Call lpfc_sli4_queue_unset() in restart and rmmod paths
[ Upstream commit d35f767271 ]

During initialization, the driver allocates wq->pring in lpfc_wq_create
and lpfc_sli4_queue_unset() is the only place where kfree(wq->pring) is
called.

There is a possible memory leak in lpfc_sli_brdrestart_s4() (restart)
and lpfc_pci_remove_one_s4() (rmmod) paths because there are no calls to
lpfc_sli4_queue_unset() to kfree() the wq->pring.

Fix by inserting a call to lpfc_sli4_queue_unset() in
lpfc_sli_brdrestart_s4() and lpfc_sli4_hba_unset() routines.  Also, add
a check for the SLI_ACTIVE flag before issuing the Q_DESTROY mailbox
command.  If not set, then the mailbox command will obviously fail.  In
such cases, skip issuing the mailbox command and only execute the driver
resource clean up portions of the lpfc_*q_destroy routines.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20241031223219.152342-4-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-12-14 20:00:11 +01:00
..
lpfc.h scsi: lpfc: Use a dedicated lock for ras_fwlog state 2024-05-17 12:02:09 +02:00
lpfc_attr.c scsi: lpfc: Fix a possible null pointer dereference 2024-08-03 08:53:59 +02:00
lpfc_attr.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_bsg.c scsi: lpfc: Fix overflow build issue 2024-09-30 16:25:08 +02:00
lpfc_bsg.h scsi: lpfc: Copyright updates for 14.2.0.5 patches 2022-07-07 17:21:44 -04:00
lpfc_compat.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_crtn.h scsi: lpfc: Replace blk_irq_poll intr handler with threaded IRQ 2023-05-08 07:16:05 -04:00
lpfc_ct.c scsi: lpfc: Ensure DA_ID handling completion before deleting an NPIV instance 2024-10-17 15:24:21 +02:00
lpfc_debugfs.c scsi: lpfc: Use a dedicated lock for ras_fwlog state 2024-05-17 12:02:09 +02:00
lpfc_debugfs.h scsi: lpfc: Copyright updates for 14.2.0.6 patches 2022-08-31 23:39:58 -04:00
lpfc_disc.h scsi: lpfc: Ensure DA_ID handling completion before deleting an NPIV instance 2024-10-17 15:24:21 +02:00
lpfc_els.c scsi: lpfc: Add ELS_RSP cmd to the list of WQEs to flush in lpfc_els_flush_cmd() 2024-10-17 15:24:21 +02:00
lpfc_hbadisc.c scsi: lpfc: Validate hdwq pointers before dereferencing in reset/errata paths 2024-12-09 10:32:39 +01:00
lpfc_hw.h scsi: lpfc: Set Establish Image Pair service parameter only for Target Functions 2023-07-23 16:17:07 -04:00
lpfc_hw4.h scsi: lpfc: Clean up SLI-4 CQE status handling 2023-05-31 18:14:20 -04:00
lpfc_ids.h scsi: lpfc: Copyright updates for 14.2.0.5 patches 2022-07-07 17:21:44 -04:00
lpfc_init.c scsi: lpfc: Call lpfc_sli4_queue_unset() in restart and rmmod paths 2024-12-14 20:00:11 +01:00
lpfc_logmsg.h scsi: lpfc: Copyright updates for 14.2.0.13 patches 2023-05-31 18:14:20 -04:00
lpfc_mbox.c scsi: lpfc: Fix double word in comments 2023-02-21 22:00:51 -05:00
lpfc_mem.c scsi: lpfc: Copyright updates for 14.2.0.6 patches 2022-08-31 23:39:58 -04:00
lpfc_nl.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_nportdisc.c scsi: lpfc: Update PRLO handling in direct attached topology 2024-10-10 11:57:37 +02:00
lpfc_nvme.c scsi: lpfc: Replace hbalock with ndlp lock in lpfc_nvme_unregister_port() 2024-05-17 12:02:09 +02:00
lpfc_nvme.h scsi: lpfc: Copyright updates for 14.2.0.0 patches 2022-03-15 13:51:50 -04:00
lpfc_nvmet.c scsi: lpfc: Correct size for wqe for memset() 2024-04-03 15:29:03 +02:00
lpfc_scsi.c scsi: lpfc: Validate hdwq pointers before dereferencing in reset/errata paths 2024-12-09 10:32:39 +01:00
lpfc_scsi.h scsi: lpfc: Copyright updates for 14.2.0.6 patches 2022-08-31 23:39:58 -04:00
lpfc_sli.c scsi: lpfc: Call lpfc_sli4_queue_unset() in restart and rmmod paths 2024-12-14 20:00:11 +01:00
lpfc_sli.h scsi: lpfc: Remove Menlo/Hornet related code 2022-07-07 17:21:44 -04:00
lpfc_sli4.h scsi: lpfc: Replace blk_irq_poll intr handler with threaded IRQ 2023-05-08 07:16:05 -04:00
lpfc_version.h scsi: lpfc: Update lpfc version to 14.2.0.14 2023-07-23 16:17:08 -04:00
lpfc_vmid.c scsi: lpfc: Move determination of vmid_flag after VMID reinitialization completes 2024-02-05 20:14:23 +00:00
lpfc_vport.c scsi: lpfc: Ensure DA_ID handling completion before deleting an NPIV instance 2024-10-17 15:24:21 +02:00
lpfc_vport.h scsi: lpfc: Copyright updates for 14.2.0.6 patches 2022-08-31 23:39:58 -04:00
Makefile scsi: lpfc: Commonize VMID code location 2022-05-19 20:24:56 -04:00