PCI: mediatek: Fix refcount leak in mtk_pcie_subsys_powerup()
authorMiaoqian Lin <linmq006@gmail.com>
Wed, 9 Mar 2022 09:19:52 +0000 (09:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:23:04 +0000 (10:23 +0200)
commitad1c9d13e04509ae24fae8dd2897148657323519
tree3472eea2e0961baeac9a12937288a70aaefe800a
parentd41a739cc7c17809dcfc26483289e1e2fbac4b4f
PCI: mediatek: Fix refcount leak in mtk_pcie_subsys_powerup()

[ Upstream commit 214e0d8fe4a813ae6ffd62bc2dfe7544c20914f4 ]

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: 87e8657ba99c ("PCI: mediatek: Add new method to get shared pcie-cfg base address")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/pcie-mediatek.c