public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ASoC: Intel: sst_hsw: remove kfree for memory allocated with devm_kzalloc
@ 2015-04-16 13:46 weiyj_lk
  2015-04-16 14:08 ` Jarkko Nikula
  2015-04-17 13:31 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: weiyj_lk @ 2015-04-16 13:46 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, dan.carpenter, pawel.piskorski,
	yang.jie, han.lu, jarkko.nikula
  Cc: Wei Yongjun, alsa-devel, linux-kernel

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>
---
 sound/soc/intel/haswell/sst-haswell-ipc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/intel/haswell/sst-haswell-ipc.c b/sound/soc/intel/haswell/sst-haswell-ipc.c
index 344a1e9..324eceb 100644
--- a/sound/soc/intel/haswell/sst-haswell-ipc.c
+++ b/sound/soc/intel/haswell/sst-haswell-ipc.c
@@ -2201,7 +2201,6 @@ dma_err:
 dsp_new_err:
 	sst_ipc_fini(ipc);
 ipc_init_err:
-	kfree(hsw);
 	return ret;
 }
 EXPORT_SYMBOL_GPL(sst_hsw_dsp_init);


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

* Re: [PATCH -next] ASoC: Intel: sst_hsw: remove kfree for memory allocated with devm_kzalloc
  2015-04-16 13:46 [PATCH -next] ASoC: Intel: sst_hsw: remove kfree for memory allocated with devm_kzalloc weiyj_lk
@ 2015-04-16 14:08 ` Jarkko Nikula
  2015-04-16 21:34   ` [alsa-devel] " Jin, Yao
  2015-04-17 13:31 ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Jarkko Nikula @ 2015-04-16 14:08 UTC (permalink / raw)
  To: weiyj_lk, lgirdwood, broonie, perex, tiwai, dan.carpenter,
	pawel.piskorski, yang.jie, han.lu
  Cc: Wei Yongjun, alsa-devel, linux-kernel

On 04/16/2015 04:46 PM, weiyj_lk@163.com 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>
> ---
>   sound/soc/intel/haswell/sst-haswell-ipc.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/sound/soc/intel/haswell/sst-haswell-ipc.c b/sound/soc/intel/haswell/sst-haswell-ipc.c
> index 344a1e9..324eceb 100644
> --- a/sound/soc/intel/haswell/sst-haswell-ipc.c
> +++ b/sound/soc/intel/haswell/sst-haswell-ipc.c
> @@ -2201,7 +2201,6 @@ dma_err:
>   dsp_new_err:
>   	sst_ipc_fini(ipc);
>   ipc_init_err:
> -	kfree(hsw);
>   	return ret;
>   }
>   EXPORT_SYMBOL_GPL(sst_hsw_dsp_init);
>
Similar case than with baytrail. Here introduced by commit 0e7921e9583b 
("ASoC: Intel: Use the generic IPC/mailbox APIs in Broadwell")

Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

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

* Re: [alsa-devel] [PATCH -next] ASoC: Intel: sst_hsw: remove kfree for memory allocated with devm_kzalloc
  2015-04-16 14:08 ` Jarkko Nikula
@ 2015-04-16 21:34   ` Jin, Yao
  0 siblings, 0 replies; 4+ messages in thread
From: Jin, Yao @ 2015-04-16 21:34 UTC (permalink / raw)
  To: Jarkko Nikula, weiyj_lk, lgirdwood, broonie, perex, tiwai,
	dan.carpenter, pawel.piskorski, yang.jie, han.lu
  Cc: Wei Yongjun, alsa-devel, linux-kernel

For HSW, a patch "[PATCH] ASoC: Intel: Remove invalid kfree of devm
allocated data" to fix this issue has been applied.

But yes, we also need a similar patch for Baytrail.

Thanks
Jin Yao

On 2015/4/16 22:08, Jarkko Nikula wrote:
> On 04/16/2015 04:46 PM, weiyj_lk@163.com 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>
>> ---
>>   sound/soc/intel/haswell/sst-haswell-ipc.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/sound/soc/intel/haswell/sst-haswell-ipc.c
>> b/sound/soc/intel/haswell/sst-haswell-ipc.c
>> index 344a1e9..324eceb 100644
>> --- a/sound/soc/intel/haswell/sst-haswell-ipc.c
>> +++ b/sound/soc/intel/haswell/sst-haswell-ipc.c
>> @@ -2201,7 +2201,6 @@ dma_err:
>>   dsp_new_err:
>>       sst_ipc_fini(ipc);
>>   ipc_init_err:
>> -    kfree(hsw);
>>       return ret;
>>   }
>>   EXPORT_SYMBOL_GPL(sst_hsw_dsp_init);
>>
> Similar case than with baytrail. Here introduced by commit 0e7921e9583b
> ("ASoC: Intel: Use the generic IPC/mailbox APIs in Broadwell")
> 
> Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH -next] ASoC: Intel: sst_hsw: remove kfree for memory allocated with devm_kzalloc
  2015-04-16 13:46 [PATCH -next] ASoC: Intel: sst_hsw: remove kfree for memory allocated with devm_kzalloc weiyj_lk
  2015-04-16 14:08 ` Jarkko Nikula
@ 2015-04-17 13:31 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-04-17 13:31 UTC (permalink / raw)
  To: weiyj_lk
  Cc: lgirdwood, perex, tiwai, dan.carpenter, pawel.piskorski, yang.jie,
	han.lu, jarkko.nikula, Wei Yongjun, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

On Thu, Apr 16, 2015 at 09:46:18PM +0800, weiyj_lk@163.com 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.

Like Yao said a fix for this has already been applied.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2015-04-17 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-16 13:46 [PATCH -next] ASoC: Intel: sst_hsw: remove kfree for memory allocated with devm_kzalloc weiyj_lk
2015-04-16 14:08 ` Jarkko Nikula
2015-04-16 21:34   ` [alsa-devel] " Jin, Yao
2015-04-17 13:31 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox