From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: "Shaik, ShahinaX" Date: Mon, 2 Apr 2018 23:37:54 +0530 Subject: [PATCH] ASoC: tdf8532: Fix Audio memory leakage at boot time Fix kmemleak issue in tdf8532_get_state function by relasing the local allocated memory before exiting the function. kmemleak backtrace: unreferenced object 0xffff880270cabd40 (size 32): comm "alsa_aplay", pid 2409, jiffies 4294673205 (age 91.856s) hex dump (first 32 bytes): 02 00 03 80 80 01 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] kmemleak_alloc+0x4a/0xa0 [] __kmalloc+0x128/0x210 [] tdf8532_wait_state.constprop.5+0x116/0x250 [snd_soc_tdf8532] [] tdf8532_dai_trigger+0x148/0x14d [snd_soc_tdf8532] [] soc_pcm_trigger+0x75/0x130 [] dpcm_do_trigger.isra.6+0x29/0x90 [] dpcm_be_dai_trigger+0x100/0x350 [] dpcm_fe_dai_do_trigger+0x13a/0x200 [] dpcm_fe_dai_trigger+0x38/0x40 [] snd_pcm_do_start+0x2a/0x30 [] snd_pcm_action_single+0x3b/0x90 [] snd_pcm_action+0xe1/0x110 [] snd_pcm_common_ioctl1+0x318/0xc90 [] snd_pcm_playback_ioctl1+0x19f/0x250 [] snd_pcm_playback_ioctl+0x27/0x40 [] do_vfs_ioctl+0xa8/0x620 Change-Id: I8621e17997022274509554139097d849b211f384 Signed-off-by: Shaik, ShahinaX Reviewed-on: Reviewed-by: Kale, Sanyog R Reviewed-by: Periyasamy, SriramX Reviewed-by: Singh, Guneshwor O Reviewed-by: Babu, Ramesh Reviewed-by: Shaik, Kareem M Reviewed-by: Koul, Vinod Tested-by: Madiwalar, MadiwalappaX --- sound/soc/codecs/tdf8532.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/tdf8532.c b/sound/soc/codecs/tdf8532.c index a5e2a028338c..68decd023a9d 100644 --- a/sound/soc/codecs/tdf8532.c +++ b/sound/soc/codecs/tdf8532.c @@ -165,6 +165,8 @@ static int tdf8532_get_state(struct tdf8532_priv *dev_data, *status_repl = (struct get_dev_status_repl *) repl_buff; out: + if (repl_buff) + kfree(repl_buff); return ret; } -- https://clearlinux.org