提交 214e0d8f 编写于 作者: M Miaoqian Lin 提交者: Lorenzo Pieralisi

PCI: mediatek: Fix refcount leak in mtk_pcie_subsys_powerup()

The of_find_compatible_node() function returns a node pointer with
refcount incremented, We should use of_node_put() on it when done
Add the missing of_node_put() to release the refcount.

Link: https://lore.kernel.org/r/20220309091953.5630-1-linmq006@gmail.com
Fixes: 87e8657b ("PCI: mediatek: Add new method to get shared pcie-cfg base address")
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: NAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: NMiles Chen <miles.chen@mediatek.com>
Acked-by: NRob Herring <robh@kernel.org>
上级 31231092
...@@ -1008,6 +1008,7 @@ static int mtk_pcie_subsys_powerup(struct mtk_pcie *pcie) ...@@ -1008,6 +1008,7 @@ static int mtk_pcie_subsys_powerup(struct mtk_pcie *pcie)
"mediatek,generic-pciecfg"); "mediatek,generic-pciecfg");
if (cfg_node) { if (cfg_node) {
pcie->cfg = syscon_node_to_regmap(cfg_node); pcie->cfg = syscon_node_to_regmap(cfg_node);
of_node_put(cfg_node);
if (IS_ERR(pcie->cfg)) if (IS_ERR(pcie->cfg))
return PTR_ERR(pcie->cfg); return PTR_ERR(pcie->cfg);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册