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>
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,