Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1483171 > unrolled thread

[PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap

Started byarvind.yadav.cs@gmail.com
First post2016-09-14 12:50 +0200
Last post2016-09-19 19:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap arvind.yadav.cs@gmail.com - 2016-09-14 12:50 +0200
    Re: [PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap Stephen Boyd <sboyd@codeaurora.org> - 2016-09-14 20:30 +0200
      Re: [PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap arvind Yadav <arvind.yadav.cs@gmail.com> - 2016-09-19 19:50 +0200

#1483171 — [PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap

Fromarvind.yadav.cs@gmail.com
Date2016-09-14 12:50 +0200
Subject[PATCH] clk: st: clk-flexgen: Unmap region obtained by of_iomap
Message-ID<shfVo-8d0-7@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1483527

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-09-14 20:30 +0200
Message-ID<shn6x-4hB-9@gated-at.bofh.it>
In reply to#1483171
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

[toc] | [prev] | [next] | [standalone]


#1486724

Fromarvind Yadav <arvind.yadav.cs@gmail.com>
Date2016-09-19 19:50 +0200
Message-ID<sjaRA-8rr-17@gated-at.bofh.it>
In reply to#1483527

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
>>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web