summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-03-08 07:11:54 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-08 13:58:29 +0200
commit8bf205b67ddaab0181da543c2f9548aa6aa197f9 (patch)
tree3ebbeffe1c9e4517280d838a62632a8b78409a90 /drivers/pinctrl
parent898851b2a0473f6eafba6e6795f74e01d70dcc2e (diff)
downloadlinux-stable-8bf205b67ddaab0181da543c2f9548aa6aa197f9.tar.gz
linux-stable-8bf205b67ddaab0181da543c2f9548aa6aa197f9.tar.bz2
linux-stable-8bf205b67ddaab0181da543c2f9548aa6aa197f9.zip
pinctrl: mediatek: Fix missing of_node_put() in mtk_pctrl_init
[ Upstream commit dab4df9ca919f59e5b9dd84385eaf34d4f20dbb0 ] The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: a6df410d420a ("pinctrl: mediatek: Add Pinctrl/GPIO driver for mt8135.") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220308071155.21114-1-linmq006@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mtk-common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 5f7c421ab6e7..334cb85855a9 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -1038,6 +1038,7 @@ int mtk_pctrl_init(struct platform_device *pdev,
node = of_parse_phandle(np, "mediatek,pctl-regmap", 0);
if (node) {
pctl->regmap1 = syscon_node_to_regmap(node);
+ of_node_put(node);
if (IS_ERR(pctl->regmap1))
return PTR_ERR(pctl->regmap1);
} else if (regmap) {
@@ -1051,6 +1052,7 @@ int mtk_pctrl_init(struct platform_device *pdev,
node = of_parse_phandle(np, "mediatek,pctl-regmap", 1);
if (node) {
pctl->regmap2 = syscon_node_to_regmap(node);
+ of_node_put(node);
if (IS_ERR(pctl->regmap2))
return PTR_ERR(pctl->regmap2);
}