powerpc: sysdev: fsl_msi: Add missing of_node_put() for of_parse_phandle()
PATCH 1/1 powerpc: sysdev: fsl_msi: Add missing of_node_put() for of_parse_phandle()
In fsl_setup_msi_irqs(), we should use of_node_put() for the refernece 'np' returned by of_parse_phandle() which increases the refcount.
Fixes 895d603f945ba ("powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes")
Co-authored-by Miaoqian Lin <[email protected]>
Signed-off-by Liang He <[email protected]>
---
There is an incomplete fix:
https://lore.kernel.org/all/[email protected]/
We should call of_node_put() both in fail path and normal path.
arch/powerpc/sysdev/fsl_msi.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/sysdev/fsl_msi.c +2 -0
@@ -209,8 +209,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); }msi_for_each_desc (entry, &pdev->dev,MSI_DESC_NOTASSOCIATED ) {
Signature · 1 line
2.25.1
Michael Ellerman
AppliedQuoted 5 lines · Liang He
In
fsl_setup_msi_irqs(), we should useof_node_put()for the refernece 'np' returned byof_parse_phandle()which increases the refcount.
Applied to powerpc/next.
[1/1] powerpc: sysdev: fsl_msi: Add missing of_node_put() for of_parse_phandle()
https://git.kernel.org/powerpc/c/def435c04ee984a5f9ed2711b2bfe946936c6a21
cheers