* [PATCH] clk: ti: dra7-atl-clock: fix a memory leak
@ 2014-09-12 13:39 Tero Kristo
2014-09-15 9:05 ` Peter Ujfalusi
0 siblings, 1 reply; 3+ messages in thread
From: Tero Kristo @ 2014-09-12 13:39 UTC (permalink / raw)
To: linux-arm-kernel
of_clk_add_provider makes an internal copy of the parent_names property
while its called, thus it is no longer needed after this call and can
be freed.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/clk/ti/clk-dra7-atl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c
index 4a65b41..3f9308a 100644
--- a/drivers/clk/ti/clk-dra7-atl.c
+++ b/drivers/clk/ti/clk-dra7-atl.c
@@ -199,6 +199,7 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)
if (!IS_ERR(clk)) {
of_clk_add_provider(node, of_clk_src_simple_get, clk);
+ kfree(parent_names);
return;
}
cleanup:
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] clk: ti: dra7-atl-clock: fix a memory leak
2014-09-12 13:39 [PATCH] clk: ti: dra7-atl-clock: fix a memory leak Tero Kristo
@ 2014-09-15 9:05 ` Peter Ujfalusi
2014-09-29 8:52 ` Tero Kristo
0 siblings, 1 reply; 3+ messages in thread
From: Peter Ujfalusi @ 2014-09-15 9:05 UTC (permalink / raw)
To: linux-arm-kernel
On 09/12/2014 04:39 PM, Tero Kristo wrote:
> of_clk_add_provider makes an internal copy of the parent_names property
> while its called, thus it is no longer needed after this call and can
> be freed.
Thanks Tero, indeed this was overlooked in the original driver.
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> Cc: Mike Turquette <mturquette@linaro.org>
> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
> drivers/clk/ti/clk-dra7-atl.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c
> index 4a65b41..3f9308a 100644
> --- a/drivers/clk/ti/clk-dra7-atl.c
> +++ b/drivers/clk/ti/clk-dra7-atl.c
> @@ -199,6 +199,7 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)
>
> if (!IS_ERR(clk)) {
> of_clk_add_provider(node, of_clk_src_simple_get, clk);
> + kfree(parent_names);
> return;
> }
> cleanup:
>
--
P?ter
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] clk: ti: dra7-atl-clock: fix a memory leak
2014-09-15 9:05 ` Peter Ujfalusi
@ 2014-09-29 8:52 ` Tero Kristo
0 siblings, 0 replies; 3+ messages in thread
From: Tero Kristo @ 2014-09-29 8:52 UTC (permalink / raw)
To: linux-arm-kernel
On 09/15/2014 12:05 PM, Peter Ujfalusi wrote:
> On 09/12/2014 04:39 PM, Tero Kristo wrote:
>> of_clk_add_provider makes an internal copy of the parent_names property
>> while its called, thus it is no longer needed after this call and can
>> be freed.
>
> Thanks Tero, indeed this was overlooked in the original driver.
>
> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Applied to for-v3.18/ti-clk-driver.
-Tero
>
>
>> Signed-off-by: Tero Kristo <t-kristo@ti.com>
>> Cc: Mike Turquette <mturquette@linaro.org>
>> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
>> ---
>> drivers/clk/ti/clk-dra7-atl.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c
>> index 4a65b41..3f9308a 100644
>> --- a/drivers/clk/ti/clk-dra7-atl.c
>> +++ b/drivers/clk/ti/clk-dra7-atl.c
>> @@ -199,6 +199,7 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)
>>
>> if (!IS_ERR(clk)) {
>> of_clk_add_provider(node, of_clk_src_simple_get, clk);
>> + kfree(parent_names);
>> return;
>> }
>> cleanup:
>>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-29 8:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-12 13:39 [PATCH] clk: ti: dra7-atl-clock: fix a memory leak Tero Kristo
2014-09-15 9:05 ` Peter Ujfalusi
2014-09-29 8:52 ` Tero Kristo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).