All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch: arm: Fix memory leak in realtime_counter_init()
@ 2022-11-08 14:19 ` Chen Hui
  0 siblings, 0 replies; 4+ messages in thread
From: Chen Hui @ 2022-11-08 14:19 UTC (permalink / raw)
  To: tony, linux, santosh.shilimkar
  Cc: linux-omap, linux-arm-kernel, linux-kernel, judy.chenhui, yusongping

The "sys_clk" resource is malloced by clk_get(),
it is not released when the function return.

Fixes: fa6d79d27614 ("ARM: OMAP: Add initialisation for the real-time counter.")
Signed-off-by: Chen Hui <judy.chenhui@huawei.com>
---
 arch/arm/mach-omap2/timer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 620ba69c8f11..5677c4a08f37 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -76,6 +76,7 @@ static void __init realtime_counter_init(void)
 	}
 
 	rate = clk_get_rate(sys_clk);
+	clk_put(sys_clk);
 
 	if (soc_is_dra7xx()) {
 		/*
-- 
2.17.1


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

* [PATCH] arch: arm: Fix memory leak in realtime_counter_init()
@ 2022-11-08 14:19 ` Chen Hui
  0 siblings, 0 replies; 4+ messages in thread
From: Chen Hui @ 2022-11-08 14:19 UTC (permalink / raw)
  To: tony, linux, santosh.shilimkar
  Cc: linux-omap, linux-arm-kernel, linux-kernel, judy.chenhui, yusongping

The "sys_clk" resource is malloced by clk_get(),
it is not released when the function return.

Fixes: fa6d79d27614 ("ARM: OMAP: Add initialisation for the real-time counter.")
Signed-off-by: Chen Hui <judy.chenhui@huawei.com>
---
 arch/arm/mach-omap2/timer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 620ba69c8f11..5677c4a08f37 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -76,6 +76,7 @@ static void __init realtime_counter_init(void)
 	}
 
 	rate = clk_get_rate(sys_clk);
+	clk_put(sys_clk);
 
 	if (soc_is_dra7xx()) {
 		/*
-- 
2.17.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] arch: arm: Fix memory leak in realtime_counter_init()
  2022-11-08 14:19 ` Chen Hui
@ 2022-12-14 11:05   ` Tony Lindgren
  -1 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2022-12-14 11:05 UTC (permalink / raw)
  To: Chen Hui
  Cc: linux, santosh.shilimkar, linux-omap, linux-arm-kernel,
	linux-kernel, yusongping

* Chen Hui <judy.chenhui@huawei.com> [221108 15:40]:
> The "sys_clk" resource is malloced by clk_get(),
> it is not released when the function return.

Sorry for the delays, I'll apply this for v6.3 after v6.2-rc1
is available.

Regards,

Tony

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

* Re: [PATCH] arch: arm: Fix memory leak in realtime_counter_init()
@ 2022-12-14 11:05   ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2022-12-14 11:05 UTC (permalink / raw)
  To: Chen Hui
  Cc: linux, santosh.shilimkar, linux-omap, linux-arm-kernel,
	linux-kernel, yusongping

* Chen Hui <judy.chenhui@huawei.com> [221108 15:40]:
> The "sys_clk" resource is malloced by clk_get(),
> it is not released when the function return.

Sorry for the delays, I'll apply this for v6.3 after v6.2-rc1
is available.

Regards,

Tony

_______________________________________________
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-12-14 11:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 14:19 [PATCH] arch: arm: Fix memory leak in realtime_counter_init() Chen Hui
2022-11-08 14:19 ` Chen Hui
2022-12-14 11:05 ` Tony Lindgren
2022-12-14 11:05   ` Tony Lindgren

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.