alistair23-linux/drivers/pci/controller
Wen Yang 8956388d36 PCI: iproc: Fix a leaked reference by adding missing of_node_put()
The call to of_parse_phandle() returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.

iproc_msi_init() also calls of_node_get() to increase refcount:

proc_msi_init()
 -> iproc_msi_alloc_domains()
  -> pci_msi_create_irq_domain()
   -> msi_create_irq_domain()
    -> irq_domain_create_linear()
     -> __irq_domain_add()

so irq_domain will not be affected when it is released.

Detected by coccinelle with the following warnings:
  ./drivers/pci/controller/pcie-iproc.c:1323:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1299, but without a corresponding object release within this function.
  ./drivers/pci/controller/pcie-iproc.c:1330:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1299, but without a corresponding object release within this function.

Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Scott Branden <sbranden@broadcom.com>
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-pci@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
2019-04-01 10:42:58 +01:00
..
dwc PCI: dwc: layerscape: Fix a leaked reference by adding missing of_node_put() 2019-04-01 10:39:17 +01:00
Kconfig PCI: altera: Enable driver on ARM64 2019-03-04 12:22:19 +00:00
Makefile PCI: mobiveil: Add Kconfig/Makefile entries 2018-07-30 14:30:16 +01:00
pci-aardvark.c PCI: aardvark: Fix a leaked reference by adding missing of_node_put() 2019-04-01 10:42:58 +01:00
pci-ftpci100.c
pci-host-common.c PCI: Remove unnecessary check of device_type == pci 2018-09-25 09:40:03 +01:00
pci-host-generic.c
pci-hyperv.c PCI: hv: Refactor hv_irq_unmask() to use cpumask_to_vpset() 2019-03-01 11:45:46 +00: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-thunder-ecam.c
pci-thunder-pem.c
pci-v3-semi.c
pci-versatile.c
pci-xgene-msi.c
pci-xgene.c
pcie-altera-msi.c
pcie-altera.c PCI: altera: Add Stratix 10 PCIe support 2019-03-04 12:22:03 +00: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
pcie-iproc-bcma.c
pcie-iproc-msi.c cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
pcie-iproc-platform.c
pcie-iproc.c PCI: iproc: Fix a leaked reference by adding missing of_node_put() 2019-04-01 10:42:58 +01:00
pcie-iproc.h
pcie-mediatek.c PCI: mediatek: Enlarge PCIe2AHB window size to support 4GB DRAM 2019-03-01 11:22:21 +00:00
pcie-mobiveil.c PCI: Remove unnecessary check of device_type == pci 2018-09-25 09:40:03 +01:00
pcie-rcar.c
pcie-rockchip-ep.c PCI: rockchip: Remove pci_epf_linkup() from Rockchip EP driver 2019-02-15 10:02:50 +00:00
pcie-rockchip-host.c PCI: rockchip: Fix a leaked reference by adding missing of_node_put() 2019-04-01 10:42:24 +01:00
pcie-rockchip.c
pcie-rockchip.h
pcie-tango.c
pcie-xilinx-nwl.c PCI: Remove unnecessary check of device_type == pci 2018-09-25 09:40:03 +01:00
pcie-xilinx.c PCI: Remove unnecessary check of device_type == pci 2018-09-25 09:40:03 +01:00
vmd.c PCI/VMD: Configure MPS settings before adding devices 2019-01-30 11:00:04 +00:00