diff mbox

[RESEND] ARM: pxa: ssp: remove kfree for memory allocated with devm_kzalloc

Message ID CAPgLHd9T5_auqA_4Ev_Qh6f_vZONqc8z6AcJVuV1S0VkFn4S_Q@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Sept. 24, 2013, 3:35 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
Correct Mark's mail address
---
 arch/arm/plat-pxa/ssp.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Daniel Mack Sept. 24, 2013, 8:54 a.m. UTC | #1
On 24.09.2013 05:35, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> It's not necessary to free memory allocated with devm_kzalloc
> and using kfree leads to a double free.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Acked-by: Daniel Mack <zonque@gmail.com>

Chao Xie wanted to work on getting rid of the "middle layer" the pxa ssp
driver has. If that's going to happen for 3.13, it will again affect
both the ASoC part and code in arch/arm. Therefore, I would again prefer
if ssp patches went through Mark's ASoC tree. Chao, are you still
planning to work on this?



Daniel


> ---
>  arch/arm/plat-pxa/ssp.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
> index 3ea0290..528143e 100644
> --- a/arch/arm/plat-pxa/ssp.c
> +++ b/arch/arm/plat-pxa/ssp.c
> @@ -250,7 +250,6 @@ static int pxa_ssp_remove(struct platform_device *pdev)
>  	list_del(&ssp->node);
>  	mutex_unlock(&ssp_lock);
>  
> -	kfree(ssp);
>  	return 0;
>  }
>  
>
Chao Xie Sept. 27, 2013, 2:15 a.m. UTC | #2
> -----Original Message-----
> From: Daniel Mack [mailto:zonque@gmail.com] 
> Sent: Tuesday, September 24, 2013 4:55 PM
> To: Wei Yongjun
> Cc: linux@arm.linux.org.uk; grant.likely@linaro.org; rob.herring@calxeda.com; broonie@sirena.org.uk; haojian.zhuang@gmail.com; olof@lixom.net; gregkh@linuxfoundation.org; yongjun_wei@trendmicro.com.cn; linux-arm-kernel@lists.infradead.org; Chao Xie
> Subject: Re: [PATCH RESEND] ARM: pxa: ssp: remove kfree for memory allocated with devm_kzalloc
> 
> On 24.09.2013 05:35, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> It's not necessary to free memory allocated with devm_kzalloc
> and using kfree leads to a double free.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Acked-by: Daniel Mack <zonque@gmail.com>
> 
> Chao Xie wanted to work on getting rid of the "middle layer" the pxa ssp
> driver has. If that's going to happen for 3.13, it will again affect
> both the ASoC part and code in arch/arm. Therefore, I would again prefer
> if ssp patches went through Mark's ASoC tree. Chao, are you still
> planning to work on this?
> 
For last month I had to work at other project.
I will continue to work at it at early Oct.
> 
> 
> Daniel
> 
> 
> ---
>  arch/arm/plat-pxa/ssp.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
> index 3ea0290..528143e 100644
> --- a/arch/arm/plat-pxa/ssp.c
> +++ b/arch/arm/plat-pxa/ssp.c
> @@ -250,7 +250,6 @@ static int pxa_ssp_remove(struct platform_device *pdev)
>  	list_del(&ssp->node);
>  	mutex_unlock(&ssp_lock);
>  
> -	kfree(ssp);
>  	return 0;
>  }
>  
>
diff mbox

Patch

diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index 3ea0290..528143e 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -250,7 +250,6 @@  static int pxa_ssp_remove(struct platform_device *pdev)
 	list_del(&ssp->node);
 	mutex_unlock(&ssp_lock);
 
-	kfree(ssp);
 	return 0;
 }