OrangePi_CM5/drivers/pci/controller
Krzysztof Wilczyński fa6dae9d7f PCI: mediatek: Add missing of_node_put() to fix reference leak
[ Upstream commit 42814c438aac79746d310f413a27d5b0b959c5de ]

The for_each_available_child_of_node helper internally makes use of the
of_get_next_available_child() which performs an of_node_get() on each
iteration when searching for next available child node.

Should an available child node be found, then it would return a device
node pointer with reference count incremented, thus early return from
the middle of the loop requires an explicit of_node_put() to prevent
reference count leak.

To stop the reference leak, explicitly call of_node_put() before
returning after an error occurred.

Link: https://lore.kernel.org/r/20210120184810.3068794-1-kw@linux.com
Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-17 17:06:24 +01:00
..
cadence PCI: cadence: Retrain Link to work around Gen2 training defect 2021-03-11 14:17:29 +01:00
dwc PCI: qcom: Use PHY_REFCLK_USE_PAD only for ipq8064 2021-03-04 11:37:18 +01:00
mobiveil
…
Kconfig
…
Makefile
…
pci-aardvark.c
…
pci-ftpci100.c
…
pci-host-common.c
…
pci-host-generic.c
…
pci-hyperv-intf.c
…
pci-hyperv.c
…
pci-loongson.c
…
pci-mvebu.c PCI: mvebu: Fix duplicate resource requests 2020-11-04 13:55:30 -06:00
pci-rcar-gen2.c
…
pci-tegra.c
…
pci-thunder-ecam.c
…
pci-thunder-pem.c
…
pci-v3-semi.c
…
pci-versatile.c
…
pci-xgene-msi.c PCI: xgene-msi: Fix race in installing chained irq handler 2021-03-17 17:06:24 +01:00
pci-xgene.c
…
pcie-altera-msi.c
…
pcie-altera.c
…
pcie-brcmstb.c PCI: brcmstb: Initialize "tmp" before use 2020-12-30 11:53:18 +01:00
pcie-hisi-error.c
…
pcie-iproc-bcma.c
…
pcie-iproc-msi.c
…
pcie-iproc-platform.c
…
pcie-iproc.c PCI: iproc: Invalidate correct PAXB inbound windows 2020-12-30 11:53:27 +01:00
pcie-iproc.h
…
pcie-mediatek.c PCI: mediatek: Add missing of_node_put() to fix reference leak 2021-03-17 17:06:24 +01:00
pcie-rcar-ep.c
…
pcie-rcar-host.c PCI: rcar: Always allocate MSI addresses in 32bit space 2021-03-04 11:38:11 +01:00
pcie-rcar.c
…
pcie-rcar.h
…
pcie-rockchip-ep.c
…
pcie-rockchip-host.c
…
pcie-rockchip.c PCI: rockchip: Make 'ep-gpios' DT property optional 2021-03-04 11:38:18 +01:00
pcie-rockchip.h
…
pcie-tango.c
…
pcie-xilinx-cpm.c PCI: xilinx-cpm: Fix reference count leak on error path 2021-03-04 11:38:11 +01:00
pcie-xilinx-nwl.c
…
pcie-xilinx.c
…
vmd.c
…