linux-stable/drivers/scsi/lpfc
Dick Kennedy 40b450375c scsi: lpfc: Fix shost refcount mismatch when deleting vport
[ Upstream commit 03dbfe0668 ]

When vports are deleted, it is observed that there is memory/kthread
leakage as the vport isn't fully being released.

There is a shost reference taken in scsi_add_host_dma that is not released
during scsi_remove_host. It was noticed that other drivers resolve this by
doing a scsi_host_put after calling scsi_remove_host.

The vport_delete routine is taking two references one that corresponds to
an access to the scsi_host in the vport_delete routine and another that is
released after the adapter mailbox command completes that destroys the VPI
that corresponds to the vport.

Remove one of the references taken such that the second reference that is
put will complete the missing scsi_add_host_dma reference and the shost
will be terminated.

Link: https://lore.kernel.org/r/20200630215001.70793-8-jsmart2021@gmail.com
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-03 11:26:44 +02:00
..
lpfc.h scsi: lpfc: Fix broken Credit Recovery after driver load 2020-04-17 10:50:24 +02:00
lpfc_attr.c SCSI misc on 20190919 2019-09-21 10:50:15 -07:00
lpfc_attr.h
lpfc_bsg.c scsi: lpfc: Fix memory leak on lpfc_bsg_write_ebuf_set func 2020-01-09 10:19:44 +01:00
lpfc_bsg.h
lpfc_compat.h
lpfc_crtn.h scsi: lpfc: fix inlining of lpfc_sli4_cleanup_poll_list() 2020-04-17 10:50:26 +02:00
lpfc_ct.c scsi: lpfc: Fix negation of else clause in lpfc_prep_node_fc4type 2020-06-17 16:40:35 +02:00
lpfc_debugfs.c scsi: lpfc: Remove bg debugfs buffers 2019-08-29 18:08:58 -04:00
lpfc_debugfs.h scsi: lpfc: Merge per-protocol WQ/CQ pairs into single per-cpu pair 2019-08-19 22:41:12 -04:00
lpfc_disc.h scsi: lpfc: Add NVMe sequence level error recovery support 2019-08-19 22:41:12 -04:00
lpfc_els.c scsi: lpfc: Fix lpfc_nodelist leak when processing unsolicited event 2020-06-24 17:50:17 +02:00
lpfc_hbadisc.c scsi: lpfc: Fix broken Credit Recovery after driver load 2020-04-17 10:50:24 +02:00
lpfc_hw.h
lpfc_hw4.h scsi: lpfc: Add NVMe sequence level error recovery support 2019-08-19 22:41:12 -04:00
lpfc_ids.h
lpfc_init.c scsi: lpfc: Avoid another null dereference in lpfc_sli4_hba_unset() 2020-06-30 15:37:00 -04:00
lpfc_logmsg.h
lpfc_mbox.c
lpfc_mem.c scsi: lpfc: Support dynamic unbounded SGL lists on G7 hardware. 2019-08-19 22:41:12 -04:00
lpfc_nl.h
lpfc_nportdisc.c scsi: lpfc: Fix SLI3 hba in loop mode not discovering devices 2020-01-04 19:16:45 +01:00
lpfc_nvme.c scsi: lpfc: Fix crash in target side cable pulls hitting WAIT_FOR_UNREG 2020-04-29 16:32:58 +02:00
lpfc_nvme.h
lpfc_nvmet.c scsi: lpfc: nvmet: Avoid hang / use-after-free again when destroying targetport 2020-08-21 13:05:35 +02:00
lpfc_nvmet.h
lpfc_scsi.c scsi: lpfc: Fix lpfc_io_buf resource leak in lpfc_get_scsi_buf_s4 error path 2020-04-17 10:50:19 +02:00
lpfc_scsi.h
lpfc_sli.c scsi: lpfc: Fix crash after handling a pci error 2020-04-29 16:32:57 +02:00
lpfc_sli.h scsi: lpfc: Fix bad ndlp ptr in xri aborted handling 2019-12-17 19:55:26 +01:00
lpfc_sli4.h scsi: lpfc: Add registration for CPU Offline/Online events 2020-04-17 10:50:24 +02:00
lpfc_version.h scsi: lpfc: Update lpfc version to 12.4.0.0 2019-08-19 22:41:12 -04:00
lpfc_vport.c scsi: lpfc: Fix shost refcount mismatch when deleting vport 2020-09-03 11:26:44 +02:00
lpfc_vport.h
Makefile