[alsa-devel] [PATCH] ASoC: Intel: fix Coccinelle kfree warning

Firo Yang firogm at gmail.com
Mon Apr 27 09:42:22 CEST 2015


Thanks, Jie.

I find another simlar BUG in 
./sound/soc/intel/baytrail/sst-baytrail-ipc.c::sst_byt_dsp_init()
Does anyone fixed it, too?

Regards
Firo

On Mon, Apr 27, 2015 at 07:23:32AM +0000, Jie, Yang wrote:
>> -----Original Message-----
>> From: Firo Yang [mailto:firogm at gmail.com]
>> Sent: Sunday, April 26, 2015 11:42 PM
>> To: lgirdwood at gmail.com
>> Cc: kernel-janitors at vger.kernel.org; broonie at kernel.org; perex at perex.cz;
>> tiwai at suse.de; Jie, Yang; Lu, Han; jarkko.nikula at linux.intel.com; Piskorski,
>> Pawel; alsa-devel at alsa-project.org; Firo Yang
>> Subject: [PATCH] ASoC: Intel: fix Coccinelle kfree warning
>> 
>> It's not necessary to use kfree() to free memory allocated with devm_kzalloc
>> in a probe function and using kfree leads to a double free.
>> 
>> Signed-off-by: Firo Yang <firogm at gmail.com>
>> ---
>>  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);
> 
>It has been fixed by Jin Yao 2 weeks ago:
>http://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/commit/?h=for-next&id=ac98b4c015b50b1e452f8d55b612320be7f80825
>
>~Keyon
>
>>  	return ret;
>>  }
>>  EXPORT_SYMBOL_GPL(sst_hsw_dsp_init);
>> --
>> 2.1.0
>


More information about the Alsa-devel mailing list