linux-stable/drivers/pci/hotplug
Feilong Lin dd6ba896ff ACPI / hotplug / PCI: Fix reference count leak in enable_slot()
[ Upstream commit 3bbfd31903 ]

In enable_slot(), if pci_get_slot() returns NULL, we clear the SLOT_ENABLED
flag. When pci_get_slot() finds a device, it increments the device's
reference count.  In this case, we did not call pci_dev_put() to decrement
the reference count, so the memory of the device (struct pci_dev type) will
eventually leak.

Call pci_dev_put() to decrement its reference count when pci_get_slot()
returns a PCI device.

Link: https://lore.kernel.org/r/b411af88-5049-a1c6-83ac-d104a1f429be@huawei.com
Signed-off-by: Feilong Lin <linfeilong@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-22 11:40:52 +02:00
..
acpi_pcihp.c PCI: Fix kerneldoc warnings 2020-08-05 18:23:14 -05:00
acpiphp.h
acpiphp_core.c
acpiphp_glue.c ACPI / hotplug / PCI: Fix reference count leak in enable_slot() 2021-05-22 11:40:52 +02:00
acpiphp_ibm.c
cpci_hotplug.h
cpci_hotplug_core.c
cpci_hotplug_pci.c
cpcihp_generic.c
cpcihp_zt5550.c
cpcihp_zt5550.h
cpqphp.h
cpqphp_core.c
cpqphp_ctrl.c
cpqphp_nvram.c
cpqphp_nvram.h
cpqphp_pci.c
cpqphp_sysfs.c
ibmphp.h
ibmphp_core.c
ibmphp_ebda.c
ibmphp_hpc.c
ibmphp_pci.c
ibmphp_res.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile
pci_hotplug_core.c
pciehp.h PCI: pciehp: Remove unused EMI() and HP_SUPR_RM() macros 2020-04-23 13:45:35 -05:00
pciehp_core.c PCI: Fix kerneldoc warnings 2020-08-05 18:23:14 -05:00
pciehp_ctrl.c pci-v5.10-changes 2020-10-22 12:41:00 -07:00
pciehp_hpc.c PCI: pciehp: Reduce noisiness on hot removal 2020-09-17 16:22:36 -05:00
pciehp_pci.c
pnv_php.c
rpadlpar.h
rpadlpar_core.c PCI: rpadlpar: Use for_each_child_of_node() and for_each_node_by_name() 2020-09-17 16:22:36 -05:00
rpadlpar_sysfs.c PCI: rpadlpar: Fix potential drc_name corruption in store functions 2021-03-25 09:04:16 +01:00
rpaphp.h
rpaphp_core.c PCI: Use of_node_name_eq() for node name comparisons 2020-04-24 18:02:17 -05:00
rpaphp_pci.c powerpc/eeh: Make early EEH init pseries specific 2020-03-25 12:09:39 +11:00
rpaphp_slot.c
s390_pci_hpc.c s390/pci: fix leak of PCI device structure 2021-03-25 09:04:05 +01:00
shpchp.h PCI: shpchp: Make shpchp_unconfigure_device() void 2020-05-21 15:23:20 -05:00
shpchp_core.c
shpchp_ctrl.c pci-v5.10-changes 2020-10-22 12:41:00 -07:00
shpchp_hpc.c
shpchp_pci.c PCI: shpchp: Make shpchp_unconfigure_device() void 2020-05-21 15:23:20 -05:00
shpchp_sysfs.c
TODO