summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorHuang Chao <chao7.huang@samsung.com>2014-11-12 11:44:32 +0800
committerSylwester Nawrocki <s.nawrocki@samsung.com>2014-11-27 05:39:48 -0800
commitf146ac43b1dcaf9a1ec3bb36aa4a9a572a3af3ed (patch)
tree9b73750311a5516f3f08c3658b4c23df1856445c /sound
parent6cacffa8e7643777d854b272d6789edfe9048138 (diff)
downloadlinux-3.10-f146ac43b1dcaf9a1ec3bb36aa4a9a572a3af3ed.tar.gz
linux-3.10-f146ac43b1dcaf9a1ec3bb36aa4a9a572a3af3ed.tar.bz2
linux-3.10-f146ac43b1dcaf9a1ec3bb36aa4a9a572a3af3ed.zip
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 <chao7.huang@samsung.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/samsung/dma.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
index fa31d1784f4..b418b6fa68d 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,