1
0
Fork 0
alistair23-linux/drivers/pci/controller
Thomas Gleixner 36f7355545 irqdomain/treewide: Keep firmware node unconditionally allocated
[ Upstream commit e3beca48a4 ]

Quite some non OF/ACPI users of irqdomains allocate firmware nodes of type
IRQCHIP_FWNODE_NAMED or IRQCHIP_FWNODE_NAMED_ID and free them right after
creating the irqdomain. The only purpose of these FW nodes is to convey
name information. When this was introduced the core code did not store the
pointer to the node in the irqdomain. A recent change stored the firmware
node pointer in irqdomain for other reasons and missed to notice that the
usage sites which do the alloc_fwnode/create_domain/free_fwnode sequence
are broken by this. Storing a dangling pointer is dangerous itself, but in
case that the domain is destroyed later on this leads to a double free.

Remove the freeing of the firmware node after creating the irqdomain from
all affected call sites to cure this.

Fixes: 711419e504 ("irqdomain: Add the missing assignment of domain->fwnode for named fwnode")
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/873661qakd.fsf@nanos.tec.linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-07-29 10:18:28 +02:00
..
dwc PCI: amlogic: meson: Don't use FAST_LINK_MODE to set up link 2020-06-24 17:50:31 +02:00
Kconfig PCI: hv: Add a Hyper-V PCI interface driver for software backchannel interface 2019-08-22 00:25:12 -07:00
Makefile PCI: hv: Add a Hyper-V PCI interface driver for software backchannel interface 2019-08-22 00:25:12 -07:00
pci-aardvark.c PCI: aardvark: Don't blindly enable ASPM L0s and don't write to read-only register 2020-06-24 17:50:15 +02:00
pci-ftpci100.c PCI: faraday: Fix I/O space page leak 2018-07-18 17:01:14 -05:00
pci-host-common.c PCI: Use devm_add_action_or_reset() 2019-07-24 14:20:31 -05:00
pci-host-generic.c PCI: Fix comment typos 2019-04-13 11:17:15 -05:00
pci-hyperv-intf.c PCI: hv: Add a Hyper-V PCI interface driver for software backchannel interface 2019-08-22 00:25:12 -07:00
pci-hyperv.c pci-v5.4-changes 2019-09-23 19:16:01 -07:00
pci-mvebu.c PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags 2019-02-22 10:51:14 +00:00
pci-rcar-gen2.c
pci-tegra.c PCI: tegra: Fix afi_pex2_ctrl reg offset for Tegra30 2020-02-14 16:34:09 -05:00
pci-thunder-ecam.c
pci-thunder-pem.c
pci-v3-semi.c PCI: v3-semi: Fix a memory leak in v3_pci_probe() error handling paths 2020-06-24 17:50:24 +02:00
pci-versatile.c PCI: versatile: Fix I/O space page leak 2018-07-18 17:00:11 -05:00
pci-xgene-msi.c
pci-xgene.c PCI: xgene: Fix I/O space page leak 2018-07-18 16:59:40 -05:00
pcie-altera-msi.c PCI: altera-msi: Allow building as module 2019-05-30 15:34:54 +01:00
pcie-altera.c PCI: altera: Fix configuration type based on secondary number 2019-06-17 12:22:25 +01:00
pcie-cadence-ep.c PCI: cadence: Remove pci_epf_linkup() from Cadence EP driver 2019-02-15 10:02:38 +00:00
pcie-cadence-host.c PCI: Remove unnecessary check of device_type == pci 2018-09-25 09:40:03 +01:00
pcie-cadence.c pci-v4.20-changes 2018-10-25 06:50:48 -07:00
pcie-cadence.h PCI: cadence: Add Power Management ops for host and EP 2018-07-12 12:44:14 +01:00
pcie-iproc-bcma.c
pcie-iproc-msi.c PCI: Fix comment typos 2019-04-13 11:17:15 -05:00
pcie-iproc-platform.c PCI: iproc: Propagate errors for optional PHYs 2019-09-04 15:44:05 +01:00
pcie-iproc.c PCI: iproc: Apply quirk_paxc_bridge() for module as well as built-in 2020-02-24 08:36:35 +01:00
pcie-iproc.h PCI: iproc: Reject unconfigured physical functions from PAXC 2018-07-13 11:56:55 +01:00
pcie-mediatek.c Merge branch 'pci/trivial' 2019-09-23 16:10:31 -05:00
pcie-mobiveil.c PCI: mobiveil: Fix csr_read()/write() build issue 2020-01-26 10:01:04 +01:00
pcie-rcar.c PCI: rcar: Fix incorrect programming of OB windows 2020-06-24 17:50:24 +02:00
pcie-rockchip-ep.c PCI: rockchip: Fix rockchip_pcie_ep_assert_intx() bitwise operations 2019-04-15 10:39:26 +01:00
pcie-rockchip-host.c PCI: rockchip: Propagate errors for optional regulators 2019-09-04 15:37:47 +01:00
pcie-rockchip.c
pcie-rockchip.h
pcie-tango.c
pcie-xilinx-nwl.c PCI: xilinx-nwl: Fix Multi MSI data programming 2019-06-26 10:56:51 +01:00
pcie-xilinx.c PCI: xilinx: Check for __get_free_pages() failure 2019-03-29 16:28:20 +00:00
vmd.c irqdomain/treewide: Keep firmware node unconditionally allocated 2020-07-29 10:18:28 +02:00