public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bus: arm-integrator-lm: Fix refcount leak in integrator_ap_lm_probe
@ 2022-05-23 15:34 Miaoqian Lin
  2022-06-03 10:07 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2022-05-23 15:34 UTC (permalink / raw)
  To: Linus Walleij, linux-arm-kernel, linux-kernel; +Cc: linmq006

of_find_matching_node() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/bus/arm-integrator-lm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bus/arm-integrator-lm.c b/drivers/bus/arm-integrator-lm.c
index 2344d560b144..ab5fad8aaa99 100644
--- a/drivers/bus/arm-integrator-lm.c
+++ b/drivers/bus/arm-integrator-lm.c
@@ -85,6 +85,7 @@ static int integrator_ap_lm_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 	map = syscon_node_to_regmap(syscon);
+	of_node_put(syscon);
 	if (IS_ERR(map)) {
 		dev_err(dev,
 			"could not find Integrator/AP system controller\n");
-- 
2.25.1


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

* Re: [PATCH] bus: arm-integrator-lm: Fix refcount leak in integrator_ap_lm_probe
  2022-05-23 15:34 [PATCH] bus: arm-integrator-lm: Fix refcount leak in integrator_ap_lm_probe Miaoqian Lin
@ 2022-06-03 10:07 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2022-06-03 10:07 UTC (permalink / raw)
  To: Miaoqian Lin; +Cc: linux-arm-kernel, linux-kernel

On Mon, May 23, 2022 at 5:34 PM Miaoqian Lin <linmq006@gmail.com> wrote:

> of_find_matching_node() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not need anymore.
> Add missing of_node_put() to avoid refcount leak.
>
> Fixes: ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules")
> 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-06-03 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-23 15:34 [PATCH] bus: arm-integrator-lm: Fix refcount leak in integrator_ap_lm_probe Miaoqian Lin
2022-06-03 10:07 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox