All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: soc: bcm: brcmstb: Add missing of_node_put() in biuctrl.c
@ 2022-06-15 14:02 ` Liang He
  0 siblings, 0 replies; 4+ messages in thread
From: Liang He @ 2022-06-15 14:02 UTC (permalink / raw)
  To: f.fainelli, bcm-kernel-feedback-list
  Cc: linux-arm-kernel, linux-kernel, windhl

In brcmstb_biuctrl_init(), of_find_compatible_node() will return a
node pointer with refcount incremented. We should use of_node_put()
in each fail path or when it is not used anymore.

Signed-off-by: Liang He <windhl@126.com>
---
 drivers/soc/bcm/brcmstb/biuctrl.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/bcm/brcmstb/biuctrl.c b/drivers/soc/bcm/brcmstb/biuctrl.c
index 2c975d79fe8e..1467bbd59690 100644
--- a/drivers/soc/bcm/brcmstb/biuctrl.c
+++ b/drivers/soc/bcm/brcmstb/biuctrl.c
@@ -340,12 +340,12 @@ static int __init brcmstb_biuctrl_init(void)
 
 	ret = setup_hifcpubiuctrl_regs(np);
 	if (ret)
-		return ret;
+		goto out_put;
 
 	ret = mcp_write_pairing_set();
 	if (ret) {
 		pr_err("MCP: Unable to disable write pairing!\n");
-		return ret;
+		goto out_put;
 	}
 
 	a72_b53_rac_enable_all(np);
@@ -353,6 +353,9 @@ static int __init brcmstb_biuctrl_init(void)
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&brcmstb_cpu_credit_syscore_ops);
 #endif
-	return 0;
+	ret = 0;
+out_put:
+	of_node_put(np);
+	return ret;
 }
 early_initcall(brcmstb_biuctrl_init);
-- 
2.25.1


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

* [PATCH] drivers: soc: bcm: brcmstb: Add missing of_node_put() in biuctrl.c
@ 2022-06-15 14:02 ` Liang He
  0 siblings, 0 replies; 4+ messages in thread
From: Liang He @ 2022-06-15 14:02 UTC (permalink / raw)
  To: f.fainelli, bcm-kernel-feedback-list
  Cc: linux-arm-kernel, linux-kernel, windhl

In brcmstb_biuctrl_init(), of_find_compatible_node() will return a
node pointer with refcount incremented. We should use of_node_put()
in each fail path or when it is not used anymore.

Signed-off-by: Liang He <windhl@126.com>
---
 drivers/soc/bcm/brcmstb/biuctrl.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/bcm/brcmstb/biuctrl.c b/drivers/soc/bcm/brcmstb/biuctrl.c
index 2c975d79fe8e..1467bbd59690 100644
--- a/drivers/soc/bcm/brcmstb/biuctrl.c
+++ b/drivers/soc/bcm/brcmstb/biuctrl.c
@@ -340,12 +340,12 @@ static int __init brcmstb_biuctrl_init(void)
 
 	ret = setup_hifcpubiuctrl_regs(np);
 	if (ret)
-		return ret;
+		goto out_put;
 
 	ret = mcp_write_pairing_set();
 	if (ret) {
 		pr_err("MCP: Unable to disable write pairing!\n");
-		return ret;
+		goto out_put;
 	}
 
 	a72_b53_rac_enable_all(np);
@@ -353,6 +353,9 @@ static int __init brcmstb_biuctrl_init(void)
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&brcmstb_cpu_credit_syscore_ops);
 #endif
-	return 0;
+	ret = 0;
+out_put:
+	of_node_put(np);
+	return ret;
 }
 early_initcall(brcmstb_biuctrl_init);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] drivers: soc: bcm: brcmstb: Add missing of_node_put() in biuctrl.c
  2022-06-15 14:02 ` Liang He
@ 2022-06-17 21:55   ` Florian Fainelli
  -1 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2022-06-17 21:55 UTC (permalink / raw)
  To: Liang He, f.fainelli, bcm-kernel-feedback-list
  Cc: linux-arm-kernel, linux-kernel

On 6/15/22 07:02, Liang He wrote:
> In brcmstb_biuctrl_init(), of_find_compatible_node() will return a
> node pointer with refcount incremented. We should use of_node_put()
> in each fail path or when it is not used anymore.
> 
> Signed-off-by: Liang He <windhl@126.com>

Applied, thanks!
-- 
Florian

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

* Re: [PATCH] drivers: soc: bcm: brcmstb: Add missing of_node_put() in biuctrl.c
@ 2022-06-17 21:55   ` Florian Fainelli
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2022-06-17 21:55 UTC (permalink / raw)
  To: Liang He, f.fainelli, bcm-kernel-feedback-list
  Cc: linux-arm-kernel, linux-kernel

On 6/15/22 07:02, Liang He wrote:
> In brcmstb_biuctrl_init(), of_find_compatible_node() will return a
> node pointer with refcount incremented. We should use of_node_put()
> in each fail path or when it is not used anymore.
> 
> Signed-off-by: Liang He <windhl@126.com>

Applied, thanks!
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-06-17 21:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-15 14:02 [PATCH] drivers: soc: bcm: brcmstb: Add missing of_node_put() in biuctrl.c Liang He
2022-06-15 14:02 ` Liang He
2022-06-17 21:55 ` Florian Fainelli
2022-06-17 21:55   ` Florian Fainelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.