mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] arch: mips: generic: Add missing of_node_put() in board-ranchu.c
@ 2022-06-15 14:11 Liang He
  2022-06-21 15:14 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: Liang He @ 2022-06-15 14:11 UTC (permalink / raw)
  To: miodrag.dinic, paulburton, tsbogend; +Cc: linux-mips, linux-kernel, windhl

In ranchu_measure_hpt_freq(), of_find_compatible_node() will return
a node pointer with refcount incremented. We should use of_put_node()
when it is not used anymore.

Signed-off-by: Liang He <windhl@126.com>
---
 arch/mips/generic/board-ranchu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/generic/board-ranchu.c b/arch/mips/generic/board-ranchu.c
index a89aaad59cb1..930c45041882 100644
--- a/arch/mips/generic/board-ranchu.c
+++ b/arch/mips/generic/board-ranchu.c
@@ -44,6 +44,7 @@ static __init unsigned int ranchu_measure_hpt_freq(void)
 		      __func__);
 
 	rtc_base = of_iomap(np, 0);
+	of_node_put(np);
 	if (!rtc_base)
 		panic("%s(): Failed to ioremap Goldfish RTC base!", __func__);
 
-- 
2.25.1


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

* Re: [PATCH] arch: mips: generic: Add missing of_node_put() in board-ranchu.c
  2022-06-15 14:11 [PATCH] arch: mips: generic: Add missing of_node_put() in board-ranchu.c Liang He
@ 2022-06-21 15:14 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2022-06-21 15:14 UTC (permalink / raw)
  To: Liang He; +Cc: miodrag.dinic, paulburton, linux-mips, linux-kernel

On Wed, Jun 15, 2022 at 10:11:23PM +0800, Liang He wrote:
> In ranchu_measure_hpt_freq(), of_find_compatible_node() will return
> a node pointer with refcount incremented. We should use of_put_node()
> when it is not used anymore.
> 
> Signed-off-by: Liang He <windhl@126.com>
> ---
>  arch/mips/generic/board-ranchu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/mips/generic/board-ranchu.c b/arch/mips/generic/board-ranchu.c
> index a89aaad59cb1..930c45041882 100644
> --- a/arch/mips/generic/board-ranchu.c
> +++ b/arch/mips/generic/board-ranchu.c
> @@ -44,6 +44,7 @@ static __init unsigned int ranchu_measure_hpt_freq(void)
>  		      __func__);
>  
>  	rtc_base = of_iomap(np, 0);
> +	of_node_put(np);
>  	if (!rtc_base)
>  		panic("%s(): Failed to ioremap Goldfish RTC base!", __func__);
>  
> -- 
> 2.25.1

applied to mips-fixes.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-15 14:11 [PATCH] arch: mips: generic: Add missing of_node_put() in board-ranchu.c Liang He
2022-06-21 15:14 ` Thomas Bogendoerfer

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

all inboxes | Powered by JetHome®