[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220526010935.32138-1-zhengyongjun3@huawei.com>
Date: Thu, 26 May 2022 01:09:35 +0000
From: Zheng Yongjun <zhengyongjun3@...wei.com>
To: <linuxppc-dev@...ts.ozlabs.org>, <linux-kernel@...r.kernel.org>
CC: <mpe@...erman.id.au>, <benh@...nel.crashing.org>,
<paulus@...ba.org>
Subject: [PATCH] powerpc: Fix refcount leak in fsl_setup_msi_irqs
of_parse_phandle() returns a node pointer with refcount incremented,
we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.
Fixes: 895d603f945ba ("powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes")
Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
---
arch/powerpc/sysdev/fsl_msi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index b3475ae9f236..dcc6c8997b09 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -207,6 +207,7 @@ 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;
}
}
--
2.17.1
Powered by blists - more mailing lists