aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl/imx-pcm-dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/fsl/imx-pcm-dma.c')
-rw-r--r--sound/soc/fsl/imx-pcm-dma.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c
index 89a7755b6f56..d85929b79c35 100644
--- a/sound/soc/fsl/imx-pcm-dma.c
+++ b/sound/soc/fsl/imx-pcm-dma.c
@@ -109,6 +109,9 @@ static int snd_imx_open(struct snd_pcm_substream *substream)
109 dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); 109 dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
110 110
111 dma_data = kzalloc(sizeof(*dma_data), GFP_KERNEL); 111 dma_data = kzalloc(sizeof(*dma_data), GFP_KERNEL);
112 if (!dma_data)
113 return -ENOMEM;
114
112 dma_data->peripheral_type = dma_params->shared_peripheral ? 115 dma_data->peripheral_type = dma_params->shared_peripheral ?
113 IMX_DMATYPE_SSI_SP : IMX_DMATYPE_SSI; 116 IMX_DMATYPE_SSI_SP : IMX_DMATYPE_SSI;
114 dma_data->priority = DMA_PRIO_HIGH; 117 dma_data->priority = DMA_PRIO_HIGH;
@@ -117,7 +120,7 @@ static int snd_imx_open(struct snd_pcm_substream *substream)
117 ret = snd_dmaengine_pcm_open(substream, filter, dma_data); 120 ret = snd_dmaengine_pcm_open(substream, filter, dma_data);
118 if (ret) { 121 if (ret) {
119 kfree(dma_data); 122 kfree(dma_data);
120 return 0; 123 return ret;
121 } 124 }
122 125
123 snd_dmaengine_pcm_set_data(substream, dma_data); 126 snd_dmaengine_pcm_set_data(substream, dma_data);