linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe
@ 2022-03-07 11:51 Miaoqian Lin
  2022-03-15  1:23 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2022-03-07 11:51 UTC (permalink / raw)
  To: Linus Walleij, Lee Jones, linux-arm-kernel, linux-gpio, linux-kernel
  Cc: linmq006

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: 32e67eee670e ("pinctrl: nomadik: Allow prcm_base to be extracted from Device Tree")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/pinctrl/nomadik/pinctrl-nomadik.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
index 39828e9c3120..4757bf964d3c 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -1883,8 +1883,10 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
 	}
 
 	prcm_np = of_parse_phandle(np, "prcm", 0);
-	if (prcm_np)
+	if (prcm_np) {
 		npct->prcm_base = of_iomap(prcm_np, 0);
+		of_node_put(prcm_np);
+	}
 	if (!npct->prcm_base) {
 		if (version == PINCTRL_NMK_STN8815) {
 			dev_info(&pdev->dev,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe
  2022-03-07 11:51 [PATCH] pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe Miaoqian Lin
@ 2022-03-15  1:23 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2022-03-15  1:23 UTC (permalink / raw)
  To: Miaoqian Lin; +Cc: Lee Jones, linux-arm-kernel, linux-gpio, linux-kernel

On Mon, Mar 7, 2022 at 12:51 PM Miaoqian Lin <linmq006@gmail.com> wrote:

> 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: 32e67eee670e ("pinctrl: nomadik: Allow prcm_base to be extracted from Device Tree")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-15  1:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07 11:51 [PATCH] pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe Miaoqian Lin
2022-03-15  1:23 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).