]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/sysdev/fsl_msi: Add missing of_node_put()
authorLiang He <windhl@126.com>
Mon, 4 Jul 2022 14:52:33 +0000 (22:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:22:44 +0000 (13:22 +0200)
[ Upstream commit b827be425a93d87698ddd7c4fd19c23f6ec03cc3 ]

In fsl_setup_msi_irqs(), use of_node_put() to drop the reference
returned by of_parse_phandle().

Fixes: 2399f7b2cc58a ("powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes")
Co-authored-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220704145233.278539-1-windhl@126.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/sysdev/fsl_msi.c

index 808e7118abfc5b45655156866e967a5be72030d5..d276c5e964458689ad746ffb6362694a85d6c9a1 100644 (file)
@@ -211,8 +211,10 @@ static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
                        dev_err(&pdev->dev,
                                "node %pOF has an invalid fsl,msi phandle %u\n",
                                hose->dn, np->phandle);
+                       of_node_put(np);
                        return -EINVAL;
                }
+               of_node_put(np);
        }
 
        for_each_pci_msi_entry(entry, pdev) {