ASoC: Intel: fix Coccinelle kfree warning
Subsystems (4)
PATCH 1/1 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.
--- sound/soc/intel/haswell/sst-haswell-ipc.c | 1 - 1 file changed, 1 deletion(-)
sound/soc/intel/haswell/sst-haswell-ipc.c +0 -1
@@ -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);
Signature · 1 line
2.1.0
Quoted 23 lines
-----Original Message-----
From: Firo Yang [mailto:[email protected]]
Sent: Sunday, April 26, 2015 11:42 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Jie, Yang; Lu, Han; [email protected]; Piskorski, Pawel; [email protected]; Firo Yang
Subject: [PATCH] ASoC: Intel: fix Coccinelle kfree warningIt's not necessary to use
kfree()to free memory allocated withdevm_kzallocin a probe function and using kfree leads to a double free.Signed-off-by Firo Yang <[email protected]>--- sound/soc/intel/haswell/sst-haswell-ipc.c | 1 - 1 file changed, 1 deletion(-)sound/soc/intel/haswell/sst-haswell-ipc.c +0
-0
sound/soc/intel/haswell/sst-haswell-ipc.c dma_err: · line 2204
Quoted 4 lines
sound/soc/intel/haswell/sst-haswell-ipc.c +0
-1@@ -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
Quoted 5 lines
sound/soc/intel/haswell/sst-haswell-ipc.c +0
-1return ret; }EXPORT_SYMBOL_GPL (sst_hsw_dsp_init); --2.1.0
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
Quoted 39 lines · Yang
Quoted 23 lines
-----Original Message-----
From: Firo Yang [mailto:[email protected]]
Sent: Sunday, April 26, 2015 11:42 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Jie, Yang; Lu, Han; [email protected]; Piskorski, Pawel; [email protected]; Firo Yang
Subject: [PATCH] ASoC: Intel: fix Coccinelle kfree warningIt's not necessary to use
kfree()to free memory allocated withdevm_kzallocin a probe function and using kfree leads to a double free.Signed-off-by Firo Yang <[email protected]>--- sound/soc/intel/haswell/sst-haswell-ipc.c | 1 - 1 file changed, 1 deletion(-)sound/soc/intel/haswell/sst-haswell-ipc.c +0
-0sound/soc/intel/haswell/sst-haswell-ipc.c dma_err: · line 2204
Quoted 4 lines
sound/soc/intel/haswell/sst-haswell-ipc.c +0
-1@@ -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
Quoted 5 lines
sound/soc/intel/haswell/sst-haswell-ipc.c +0
-1return ret; }EXPORT_SYMBOL_GPL (sst_hsw_dsp_init); --2.1.0
Quoted 10 lines
-----Original Message-----
From: Firo Yang [mailto:[email protected]]
Sent: Monday, April 27, 2015 3:42 PM
To: Jie, Yang
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Lu, Han; [email protected]; Piskorski, Pawel; [email protected]; Jin, Yao
Subject: Re: [PATCH] ASoC: Intel: fix Coccinelle kfree warning
Quoted 5 lines
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?
I guess so. You can refer to the for-next branch of git repo to confirm it:git://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git
~Keyon
Quoted 46 lines
Regards
FiroQuoted 41 lines · Yang
Quoted 24 lines
-----Original Message-----
From: Firo Yang [mailto:[email protected]]
Sent: Sunday, April 26, 2015 11:42 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Jie, Yang; Lu, Han; [email protected]; Piskorski, Pawel; [email protected]; Firo Yang
Subject: [PATCH] ASoC: Intel: fix Coccinelle kfree warningIt's not necessary to use
kfree()to free memory allocated withdevm_kzallocin a probe function and using kfree leads to a double free.Signed-off-by Firo Yang <[email protected]>--- sound/soc/intel/haswell/sst-haswell-ipc.c | 1 - 1 file changed, 1 deletion(-)sound/soc/intel/haswell/sst-haswell-ipc.c +0
-0sound/soc/intel/haswell/sst-haswell-ipc.c dma_err: · line 2204
Quoted 4 lines
sound/soc/intel/haswell/sst-haswell-ipc.c +0
-1@@ -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
Quoted 5 lines
sound/soc/intel/haswell/sst-haswell-ipc.c +0
-1return ret; }EXPORT_SYMBOL_GPL (sst_hsw_dsp_init); --2.1.0