* [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
@ 2022-06-16 2:17 ` Liang He
0 siblings, 0 replies; 15+ messages in thread
From: Liang He @ 2022-06-16 2:17 UTC (permalink / raw)
To: linux, heiko; +Cc: linux-arm-kernel, linux-rockchip, linux-kernel, windhl
In rockchip_suspend_init(), of_find_matching_node_and_match() will
return a node pointer with refcount incremented. We should use
of_node_put() in fail path or when it is not used anymore.
Signed-off-by: Liang He <windhl@126.com>
---
changelog:
v2: (1) use real name for Sob (2) use goto-label patch style
v1: add of_node_put() for each return
arch/arm/mach-rockchip/pm.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c
index 87389d9456b9..bb46ac4f65d4 100644
--- a/arch/arm/mach-rockchip/pm.c
+++ b/arch/arm/mach-rockchip/pm.c
@@ -311,7 +311,7 @@ void __init rockchip_suspend_init(void)
&match);
if (!match) {
pr_err("Failed to find PMU node\n");
- return;
+ goto out_put;
}
pm_data = (struct rockchip_pm_data *) match->data;
@@ -320,9 +320,13 @@ void __init rockchip_suspend_init(void)
if (ret) {
pr_err("%s: matches init error %d\n", __func__, ret);
- return;
+ goto out_put;
}
}
suspend_set_ops(pm_data->ops);
+
+out_put:
+ of_node_put(np);
+
}
--
2.25.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
@ 2022-06-16 2:17 ` Liang He
0 siblings, 0 replies; 15+ messages in thread
From: Liang He @ 2022-06-16 2:17 UTC (permalink / raw)
To: linux, heiko; +Cc: linux-arm-kernel, linux-rockchip, linux-kernel, windhl
In rockchip_suspend_init(), of_find_matching_node_and_match() will
return a node pointer with refcount incremented. We should use
of_node_put() in fail path or when it is not used anymore.
Signed-off-by: Liang He <windhl@126.com>
---
changelog:
v2: (1) use real name for Sob (2) use goto-label patch style
v1: add of_node_put() for each return
arch/arm/mach-rockchip/pm.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c
index 87389d9456b9..bb46ac4f65d4 100644
--- a/arch/arm/mach-rockchip/pm.c
+++ b/arch/arm/mach-rockchip/pm.c
@@ -311,7 +311,7 @@ void __init rockchip_suspend_init(void)
&match);
if (!match) {
pr_err("Failed to find PMU node\n");
- return;
+ goto out_put;
}
pm_data = (struct rockchip_pm_data *) match->data;
@@ -320,9 +320,13 @@ void __init rockchip_suspend_init(void)
if (ret) {
pr_err("%s: matches init error %d\n", __func__, ret);
- return;
+ goto out_put;
}
}
suspend_set_ops(pm_data->ops);
+
+out_put:
+ of_node_put(np);
+
}
--
2.25.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
@ 2022-06-16 2:17 ` Liang He
0 siblings, 0 replies; 15+ messages in thread
From: Liang He @ 2022-06-16 2:17 UTC (permalink / raw)
To: linux, heiko; +Cc: linux-arm-kernel, linux-rockchip, linux-kernel, windhl
In rockchip_suspend_init(), of_find_matching_node_and_match() will
return a node pointer with refcount incremented. We should use
of_node_put() in fail path or when it is not used anymore.
Signed-off-by: Liang He <windhl@126.com>
---
changelog:
v2: (1) use real name for Sob (2) use goto-label patch style
v1: add of_node_put() for each return
arch/arm/mach-rockchip/pm.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c
index 87389d9456b9..bb46ac4f65d4 100644
--- a/arch/arm/mach-rockchip/pm.c
+++ b/arch/arm/mach-rockchip/pm.c
@@ -311,7 +311,7 @@ void __init rockchip_suspend_init(void)
&match);
if (!match) {
pr_err("Failed to find PMU node\n");
- return;
+ goto out_put;
}
pm_data = (struct rockchip_pm_data *) match->data;
@@ -320,9 +320,13 @@ void __init rockchip_suspend_init(void)
if (ret) {
pr_err("%s: matches init error %d\n", __func__, ret);
- return;
+ goto out_put;
}
}
suspend_set_ops(pm_data->ops);
+
+out_put:
+ of_node_put(np);
+
}
--
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] 15+ messages in thread
* Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
2022-06-16 2:17 ` Liang He
(?)
@ 2022-06-17 17:10 ` Heiko Stuebner
-1 siblings, 0 replies; 15+ messages in thread
From: Heiko Stuebner @ 2022-06-17 17:10 UTC (permalink / raw)
To: linux, Liang He
Cc: Heiko Stuebner, linux-kernel, linux-arm-kernel, linux-rockchip
On Thu, 16 Jun 2022 10:17:13 +0800, Liang He wrote:
> In rockchip_suspend_init(), of_find_matching_node_and_match() will
> return a node pointer with refcount incremented. We should use
> of_node_put() in fail path or when it is not used anymore.
Applied, thanks!
[1/1] arm: mach-rockchip: (pm) Add missing of_node_put()
commit f4470dbfb5ff92804650bc71d115c3f150d430f6
There was an unneeded tab in the blank line above out_put
and a completely unneeded blank line added at the end of
the function. I dropped both.
Best regards,
--
Heiko Stuebner <heiko@sntech.de>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
@ 2022-06-17 17:10 ` Heiko Stuebner
0 siblings, 0 replies; 15+ messages in thread
From: Heiko Stuebner @ 2022-06-17 17:10 UTC (permalink / raw)
To: linux, Liang He
Cc: Heiko Stuebner, linux-kernel, linux-arm-kernel, linux-rockchip
On Thu, 16 Jun 2022 10:17:13 +0800, Liang He wrote:
> In rockchip_suspend_init(), of_find_matching_node_and_match() will
> return a node pointer with refcount incremented. We should use
> of_node_put() in fail path or when it is not used anymore.
Applied, thanks!
[1/1] arm: mach-rockchip: (pm) Add missing of_node_put()
commit f4470dbfb5ff92804650bc71d115c3f150d430f6
There was an unneeded tab in the blank line above out_put
and a completely unneeded blank line added at the end of
the function. I dropped both.
Best regards,
--
Heiko Stuebner <heiko@sntech.de>
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
@ 2022-06-17 17:10 ` Heiko Stuebner
0 siblings, 0 replies; 15+ messages in thread
From: Heiko Stuebner @ 2022-06-17 17:10 UTC (permalink / raw)
To: linux, Liang He
Cc: Heiko Stuebner, linux-kernel, linux-arm-kernel, linux-rockchip
On Thu, 16 Jun 2022 10:17:13 +0800, Liang He wrote:
> In rockchip_suspend_init(), of_find_matching_node_and_match() will
> return a node pointer with refcount incremented. We should use
> of_node_put() in fail path or when it is not used anymore.
Applied, thanks!
[1/1] arm: mach-rockchip: (pm) Add missing of_node_put()
commit f4470dbfb5ff92804650bc71d115c3f150d430f6
There was an unneeded tab in the blank line above out_put
and a completely unneeded blank line added at the end of
the function. I dropped both.
Best regards,
--
Heiko Stuebner <heiko@sntech.de>
_______________________________________________
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] 15+ messages in thread
* Re:Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
2022-06-17 17:10 ` Heiko Stuebner
(?)
@ 2022-06-18 2:43 ` Liang He
-1 siblings, 0 replies; 15+ messages in thread
From: Liang He @ 2022-06-18 2:43 UTC (permalink / raw)
To: Heiko Stuebner; +Cc: linux, linux-kernel, linux-arm-kernel, linux-rockchip
At 2022-06-18 01:10:28, "Heiko Stuebner" <heiko@sntech.de> wrote:
>On Thu, 16 Jun 2022 10:17:13 +0800, Liang He wrote:
>> In rockchip_suspend_init(), of_find_matching_node_and_match() will
>> return a node pointer with refcount incremented. We should use
>> of_node_put() in fail path or when it is not used anymore.
>
>Applied, thanks!
>
>[1/1] arm: mach-rockchip: (pm) Add missing of_node_put()
> commit f4470dbfb5ff92804650bc71d115c3f150d430f6
>
>There was an unneeded tab in the blank line above out_put
>and a completely unneeded blank line added at the end of
>the function. I dropped both.
Thanks very much for your effort.
I am learning the coding style for kernel code.
>
>Best regards,
>--
>Heiko Stuebner <heiko@sntech.de>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re:Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
@ 2022-06-18 2:43 ` Liang He
0 siblings, 0 replies; 15+ messages in thread
From: Liang He @ 2022-06-18 2:43 UTC (permalink / raw)
To: Heiko Stuebner; +Cc: linux, linux-kernel, linux-arm-kernel, linux-rockchip
At 2022-06-18 01:10:28, "Heiko Stuebner" <heiko@sntech.de> wrote:
>On Thu, 16 Jun 2022 10:17:13 +0800, Liang He wrote:
>> In rockchip_suspend_init(), of_find_matching_node_and_match() will
>> return a node pointer with refcount incremented. We should use
>> of_node_put() in fail path or when it is not used anymore.
>
>Applied, thanks!
>
>[1/1] arm: mach-rockchip: (pm) Add missing of_node_put()
> commit f4470dbfb5ff92804650bc71d115c3f150d430f6
>
>There was an unneeded tab in the blank line above out_put
>and a completely unneeded blank line added at the end of
>the function. I dropped both.
Thanks very much for your effort.
I am learning the coding style for kernel code.
>
>Best regards,
>--
>Heiko Stuebner <heiko@sntech.de>
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re:Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
@ 2022-06-18 2:43 ` Liang He
0 siblings, 0 replies; 15+ messages in thread
From: Liang He @ 2022-06-18 2:43 UTC (permalink / raw)
To: Heiko Stuebner; +Cc: linux, linux-kernel, linux-arm-kernel, linux-rockchip
At 2022-06-18 01:10:28, "Heiko Stuebner" <heiko@sntech.de> wrote:
>On Thu, 16 Jun 2022 10:17:13 +0800, Liang He wrote:
>> In rockchip_suspend_init(), of_find_matching_node_and_match() will
>> return a node pointer with refcount incremented. We should use
>> of_node_put() in fail path or when it is not used anymore.
>
>Applied, thanks!
>
>[1/1] arm: mach-rockchip: (pm) Add missing of_node_put()
> commit f4470dbfb5ff92804650bc71d115c3f150d430f6
>
>There was an unneeded tab in the blank line above out_put
>and a completely unneeded blank line added at the end of
>the function. I dropped both.
Thanks very much for your effort.
I am learning the coding style for kernel code.
>
>Best regards,
>--
>Heiko Stuebner <heiko@sntech.de>
_______________________________________________
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] 15+ messages in thread
* Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
2022-06-16 2:17 ` Liang He
(?)
@ 2022-06-22 9:00 ` Krzysztof Kozlowski
-1 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-22 9:00 UTC (permalink / raw)
To: Liang He, linux, heiko; +Cc: linux-arm-kernel, linux-rockchip, linux-kernel
On 16/06/2022 04:17, Liang He wrote:
> In rockchip_suspend_init(), of_find_matching_node_and_match() will
> return a node pointer with refcount incremented. We should use
> of_node_put() in fail path or when it is not used anymore.
>
> Signed-off-by: Liang He <windhl@126.com>
> ---
> changelog:
>
> v2: (1) use real name for Sob (2) use goto-label patch style
> v1: add of_node_put() for each return
>
Before applying the patch please check it carefully. Previous evidence
[1][2] suggests that not it was not even compiled.
[1] https://lore.kernel.org/all/202206221602.odN70SHs-lkp@intel.com/
[2]
https://lore.kernel.org/all/16f9a971.44e5.1817068ee3c.Coremail.windhl@126.com/
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
@ 2022-06-22 9:00 ` Krzysztof Kozlowski
0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-22 9:00 UTC (permalink / raw)
To: Liang He, linux, heiko; +Cc: linux-arm-kernel, linux-rockchip, linux-kernel
On 16/06/2022 04:17, Liang He wrote:
> In rockchip_suspend_init(), of_find_matching_node_and_match() will
> return a node pointer with refcount incremented. We should use
> of_node_put() in fail path or when it is not used anymore.
>
> Signed-off-by: Liang He <windhl@126.com>
> ---
> changelog:
>
> v2: (1) use real name for Sob (2) use goto-label patch style
> v1: add of_node_put() for each return
>
Before applying the patch please check it carefully. Previous evidence
[1][2] suggests that not it was not even compiled.
[1] https://lore.kernel.org/all/202206221602.odN70SHs-lkp@intel.com/
[2]
https://lore.kernel.org/all/16f9a971.44e5.1817068ee3c.Coremail.windhl@126.com/
Best regards,
Krzysztof
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
@ 2022-06-22 9:00 ` Krzysztof Kozlowski
0 siblings, 0 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-22 9:00 UTC (permalink / raw)
To: Liang He, linux, heiko; +Cc: linux-arm-kernel, linux-rockchip, linux-kernel
On 16/06/2022 04:17, Liang He wrote:
> In rockchip_suspend_init(), of_find_matching_node_and_match() will
> return a node pointer with refcount incremented. We should use
> of_node_put() in fail path or when it is not used anymore.
>
> Signed-off-by: Liang He <windhl@126.com>
> ---
> changelog:
>
> v2: (1) use real name for Sob (2) use goto-label patch style
> v1: add of_node_put() for each return
>
Before applying the patch please check it carefully. Previous evidence
[1][2] suggests that not it was not even compiled.
[1] https://lore.kernel.org/all/202206221602.odN70SHs-lkp@intel.com/
[2]
https://lore.kernel.org/all/16f9a971.44e5.1817068ee3c.Coremail.windhl@126.com/
Best regards,
Krzysztof
_______________________________________________
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] 15+ messages in thread
* Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
2022-06-22 9:00 ` Krzysztof Kozlowski
(?)
@ 2022-06-22 13:10 ` Heiko Stuebner
-1 siblings, 0 replies; 15+ messages in thread
From: Heiko Stuebner @ 2022-06-22 13:10 UTC (permalink / raw)
To: Liang He, linux, Krzysztof Kozlowski
Cc: linux-arm-kernel, linux-rockchip, linux-kernel
Am Mittwoch, 22. Juni 2022, 11:00:11 CEST schrieb Krzysztof Kozlowski:
> On 16/06/2022 04:17, Liang He wrote:
> > In rockchip_suspend_init(), of_find_matching_node_and_match() will
> > return a node pointer with refcount incremented. We should use
> > of_node_put() in fail path or when it is not used anymore.
> >
> > Signed-off-by: Liang He <windhl@126.com>
> > ---
> > changelog:
> >
> > v2: (1) use real name for Sob (2) use goto-label patch style
> > v1: add of_node_put() for each return
> >
>
> Before applying the patch please check it carefully. Previous evidence
> [1][2] suggests that not it was not even compiled.
thanks noticing possible issues and for the heads up :-) .
I re-examined the patch and at least in this case the of_node_put addition
looks correct - the original code was missing this and not putting the node
it got in the error case. And the change also compiles :-) .
Heiko
> [1] https://lore.kernel.org/all/202206221602.odN70SHs-lkp@intel.com/
>
> [2]
> https://lore.kernel.org/all/16f9a971.44e5.1817068ee3c.Coremail.windhl@126.com/
>
>
> Best regards,
> Krzysztof
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
@ 2022-06-22 13:10 ` Heiko Stuebner
0 siblings, 0 replies; 15+ messages in thread
From: Heiko Stuebner @ 2022-06-22 13:10 UTC (permalink / raw)
To: Liang He, linux, Krzysztof Kozlowski
Cc: linux-arm-kernel, linux-rockchip, linux-kernel
Am Mittwoch, 22. Juni 2022, 11:00:11 CEST schrieb Krzysztof Kozlowski:
> On 16/06/2022 04:17, Liang He wrote:
> > In rockchip_suspend_init(), of_find_matching_node_and_match() will
> > return a node pointer with refcount incremented. We should use
> > of_node_put() in fail path or when it is not used anymore.
> >
> > Signed-off-by: Liang He <windhl@126.com>
> > ---
> > changelog:
> >
> > v2: (1) use real name for Sob (2) use goto-label patch style
> > v1: add of_node_put() for each return
> >
>
> Before applying the patch please check it carefully. Previous evidence
> [1][2] suggests that not it was not even compiled.
thanks noticing possible issues and for the heads up :-) .
I re-examined the patch and at least in this case the of_node_put addition
looks correct - the original code was missing this and not putting the node
it got in the error case. And the change also compiles :-) .
Heiko
> [1] https://lore.kernel.org/all/202206221602.odN70SHs-lkp@intel.com/
>
> [2]
> https://lore.kernel.org/all/16f9a971.44e5.1817068ee3c.Coremail.windhl@126.com/
>
>
> Best regards,
> Krzysztof
>
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put()
@ 2022-06-22 13:10 ` Heiko Stuebner
0 siblings, 0 replies; 15+ messages in thread
From: Heiko Stuebner @ 2022-06-22 13:10 UTC (permalink / raw)
To: Liang He, linux, Krzysztof Kozlowski
Cc: linux-arm-kernel, linux-rockchip, linux-kernel
Am Mittwoch, 22. Juni 2022, 11:00:11 CEST schrieb Krzysztof Kozlowski:
> On 16/06/2022 04:17, Liang He wrote:
> > In rockchip_suspend_init(), of_find_matching_node_and_match() will
> > return a node pointer with refcount incremented. We should use
> > of_node_put() in fail path or when it is not used anymore.
> >
> > Signed-off-by: Liang He <windhl@126.com>
> > ---
> > changelog:
> >
> > v2: (1) use real name for Sob (2) use goto-label patch style
> > v1: add of_node_put() for each return
> >
>
> Before applying the patch please check it carefully. Previous evidence
> [1][2] suggests that not it was not even compiled.
thanks noticing possible issues and for the heads up :-) .
I re-examined the patch and at least in this case the of_node_put addition
looks correct - the original code was missing this and not putting the node
it got in the error case. And the change also compiles :-) .
Heiko
> [1] https://lore.kernel.org/all/202206221602.odN70SHs-lkp@intel.com/
>
> [2]
> https://lore.kernel.org/all/16f9a971.44e5.1817068ee3c.Coremail.windhl@126.com/
>
>
> Best regards,
> Krzysztof
>
_______________________________________________
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] 15+ messages in thread
end of thread, other threads:[~2022-06-22 13:13 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16 2:17 [PATCH v2] arm: mach-rockchip: (pm) Add missing of_node_put() Liang He
2022-06-16 2:17 ` Liang He
2022-06-16 2:17 ` Liang He
2022-06-17 17:10 ` Heiko Stuebner
2022-06-17 17:10 ` Heiko Stuebner
2022-06-17 17:10 ` Heiko Stuebner
2022-06-18 2:43 ` Liang He
2022-06-18 2:43 ` Liang He
2022-06-18 2:43 ` Liang He
2022-06-22 9:00 ` Krzysztof Kozlowski
2022-06-22 9:00 ` Krzysztof Kozlowski
2022-06-22 9:00 ` Krzysztof Kozlowski
2022-06-22 13:10 ` Heiko Stuebner
2022-06-22 13:10 ` Heiko Stuebner
2022-06-22 13:10 ` Heiko Stuebner
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.