* [PATCH] PCI: xilinx-nwl: add missing of_node_put()
@ 2018-06-14 9:04 Nicholas Mc Guire
2018-06-29 13:43 ` Lorenzo Pieralisi
0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2018-06-14 9:04 UTC (permalink / raw)
To: Lorenzo Pieralisi
Cc: Bjorn Helgaas, Michal Simek, linux-pci, linux-arm-kernel,
linux-kernel, Nicholas Mc Guire
The call to of_get_next_child() returns a node pointer with
refcount incremented thus it must be explicitly decremented
here after the last usage.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: commit ab597d35ef11 ("PCI: xilinx-nwl: Add support for Xilinx NWL PCIe Host Controller")
---
Problem found by an experimental cocinelle script
Patch was compile tested with: multi_v7_defconfig + ARCH_ZYNQ=y,
COMPILE_TEST=y, PCIE_XILINX_NWL=y
(one sparse warning though not related to the change proposed though)
Patch is against 4.17.0 (localversion-next is next-20180613)
drivers/pci/controller/pcie-xilinx-nwl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/controller/pcie-xilinx-nwl.c
index 6a4bbb5..fb32840 100644
--- a/drivers/pci/controller/pcie-xilinx-nwl.c
+++ b/drivers/pci/controller/pcie-xilinx-nwl.c
@@ -559,7 +559,7 @@ static int nwl_pcie_init_irq_domain(struct nwl_pcie *pcie)
PCI_NUM_INTX,
&legacy_domain_ops,
pcie);
-
+ of_node_put(legacy_intc_node);
if (!pcie->legacy_irq_domain) {
dev_err(dev, "failed to create IRQ domain\n");
return -ENOMEM;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: xilinx-nwl: add missing of_node_put()
2018-06-14 9:04 [PATCH] PCI: xilinx-nwl: add missing of_node_put() Nicholas Mc Guire
@ 2018-06-29 13:43 ` Lorenzo Pieralisi
0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2018-06-29 13:43 UTC (permalink / raw)
To: Nicholas Mc Guire
Cc: Bjorn Helgaas, Michal Simek, linux-pci, linux-arm-kernel, linux-kernel
On Thu, Jun 14, 2018 at 11:04:34AM +0200, Nicholas Mc Guire wrote:
> The call to of_get_next_child() returns a node pointer with
> refcount incremented thus it must be explicitly decremented
> here after the last usage.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> Fixes: commit ab597d35ef11 ("PCI: xilinx-nwl: Add support for Xilinx NWL PCIe Host Controller")
> ---
>
> Problem found by an experimental cocinelle script
>
> Patch was compile tested with: multi_v7_defconfig + ARCH_ZYNQ=y,
> COMPILE_TEST=y, PCIE_XILINX_NWL=y
> (one sparse warning though not related to the change proposed though)
>
> Patch is against 4.17.0 (localversion-next is next-20180613)
>
> drivers/pci/controller/pcie-xilinx-nwl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to pci/controller-fixes to be tentatively merged for
-rc4, thanks.
Lorenzo
> diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/controller/pcie-xilinx-nwl.c
> index 6a4bbb5..fb32840 100644
> --- a/drivers/pci/controller/pcie-xilinx-nwl.c
> +++ b/drivers/pci/controller/pcie-xilinx-nwl.c
> @@ -559,7 +559,7 @@ static int nwl_pcie_init_irq_domain(struct nwl_pcie *pcie)
> PCI_NUM_INTX,
> &legacy_domain_ops,
> pcie);
> -
> + of_node_put(legacy_intc_node);
> if (!pcie->legacy_irq_domain) {
> dev_err(dev, "failed to create IRQ domain\n");
> return -ENOMEM;
> --
> 2.1.4
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-29 13:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-14 9:04 [PATCH] PCI: xilinx-nwl: add missing of_node_put() Nicholas Mc Guire
2018-06-29 13:43 ` Lorenzo Pieralisi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).