From f146ac43b1dcaf9a1ec3bb36aa4a9a572a3af3ed Mon Sep 17 00:00:00 2001 From: Huang Chao Date: Wed, 12 Nov 2014 11:44:32 +0800 Subject: [PATCH] ASoC: samsung: dma: Fix the memory resource leakage issue After we use kzalloc to allocate memory and make chan point to this block resource, then dma_request_slave_channel will overwrite the pointer chan, which can result to memory leak where chan points to. Change-Id: Ie659df4e1855abc3f57ac3c54e97a6a448dac26e Signed-off-by: Huang Chao --- sound/soc/samsung/dma.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c index fa31d17..b418b6f 100644 --- a/sound/soc/samsung/dma.c +++ b/sound/soc/samsung/dma.c @@ -114,10 +114,6 @@ static int dma_open(struct snd_pcm_substream *substream) snd_soc_set_runtime_hwparams(substream, &dma_hardware); - chan = kzalloc(sizeof(struct dma_chan), GFP_KERNEL); - if (!chan) - return -ENOMEM; - /* Request slave dma channel according to playback/capture stream */ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) chan = dma_request_slave_channel(rtd->cpu_dai->dev, -- 2.7.4