* [PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap
@ 2016-09-14 10:38 arvind.yadav.cs
2016-09-14 18:24 ` Stephen Boyd
0 siblings, 1 reply; 3+ messages in thread
From: arvind.yadav.cs @ 2016-09-14 10:38 UTC (permalink / raw)
To: mturquette, sboyd
Cc: a.hajda, lee.jones, linux-clk, linux-kernel, Arvind Yadav
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
Free memory mapping, if probe is not successful.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/clk/st/clk-flexgen.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c
index 546bd79..af8df7b 100644
--- a/drivers/clk/st/clk-flexgen.c
+++ b/drivers/clk/st/clk-flexgen.c
@@ -278,8 +278,10 @@ static void __init st_of_flexgen_setup(struct device_node *np)
return;
parents = flexgen_get_parents(np, &num_parents);
- if (!parents)
+ if (!parents) {
+ iounmap(reg);
return;
+ }
clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
if (!clk_data)
@@ -337,6 +339,8 @@ static void __init st_of_flexgen_setup(struct device_node *np)
return;
err:
+ if (reg)
+ iounmap(reg);
if (clk_data)
kfree(clk_data->clks);
kfree(clk_data);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap
2016-09-14 10:38 [PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap arvind.yadav.cs
@ 2016-09-14 18:24 ` Stephen Boyd
2016-09-19 17:44 ` arvind Yadav
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2016-09-14 18:24 UTC (permalink / raw)
To: arvind.yadav.cs; +Cc: mturquette, a.hajda, lee.jones, linux-clk, linux-kernel
On 09/14, arvind.yadav.cs@gmail.com wrote:
> @@ -337,6 +339,8 @@ static void __init st_of_flexgen_setup(struct device_node *np)
> return;
>
> err:
> + if (reg)
This is always true? Why check?
> + iounmap(reg);
> if (clk_data)
> kfree(clk_data->clks);
> kfree(clk_data);
> --
> 1.7.9.5
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap
2016-09-14 18:24 ` Stephen Boyd
@ 2016-09-19 17:44 ` arvind Yadav
0 siblings, 0 replies; 3+ messages in thread
From: arvind Yadav @ 2016-09-19 17:44 UTC (permalink / raw)
To: Stephen Boyd; +Cc: mturquette, a.hajda, lee.jones, linux-clk, linux-kernel
On Wednesday 14 September 2016 11:54 PM, Stephen Boyd wrote:
> On 09/14, arvind.yadav.cs@gmail.com wrote:
>> @@ -337,6 +339,8 @@ static void __init st_of_flexgen_setup(struct device_node *np)
>> return;
>>
>> err:
>> + if (reg)
> This is always true? Why check?
> I have removed this check. Please review updated patch.
>> + iounmap(reg);
>> if (clk_data)
>> kfree(clk_data->clks);
>> kfree(clk_data);
>> --
>> 1.7.9.5
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-19 17:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-14 10:38 [PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap arvind.yadav.cs
2016-09-14 18:24 ` Stephen Boyd
2016-09-19 17:44 ` arvind Yadav
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).