Skip to content

Commit c09ac19

Browse files
YuuoniyLinus Walleij
authored andcommitted
pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe
This node pointer is returned by of_parse_phandle() with refcount incremented in this function. Calling of_node_put() to avoid the refcount leak. Fixes: 32e67ee ("pinctrl: nomadik: Allow prcm_base to be extracted from Device Tree") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220307115116.25316-1-linmq006@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent de84503 commit c09ac19

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/pinctrl/nomadik/pinctrl-nomadik.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1883,8 +1883,10 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
18831883
}
18841884

18851885
prcm_np = of_parse_phandle(np, "prcm", 0);
1886-
if (prcm_np)
1886+
if (prcm_np) {
18871887
npct->prcm_base = of_iomap(prcm_np, 0);
1888+
of_node_put(prcm_np);
1889+
}
18881890
if (!npct->prcm_base) {
18891891
if (version == PINCTRL_NMK_STN8815) {
18901892
dev_info(&pdev->dev,

0 commit comments

Comments
 (0)