aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/imx/imx-pcm-dma-mx2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c
index 05f19c9284f4..0a595da4811d 100644
--- a/sound/soc/imx/imx-pcm-dma-mx2.c
+++ b/sound/soc/imx/imx-pcm-dma-mx2.c
@@ -292,12 +292,16 @@ static int snd_imx_open(struct snd_pcm_substream *substream)
292 int ret; 292 int ret;
293 293
294 iprtd = kzalloc(sizeof(*iprtd), GFP_KERNEL); 294 iprtd = kzalloc(sizeof(*iprtd), GFP_KERNEL);
295 if (iprtd == NULL)
296 return -ENOMEM;
295 runtime->private_data = iprtd; 297 runtime->private_data = iprtd;
296 298
297 ret = snd_pcm_hw_constraint_integer(substream->runtime, 299 ret = snd_pcm_hw_constraint_integer(substream->runtime,
298 SNDRV_PCM_HW_PARAM_PERIODS); 300 SNDRV_PCM_HW_PARAM_PERIODS);
299 if (ret < 0) 301 if (ret < 0) {
302 kfree(iprtd);
300 return ret; 303 return ret;
304 }
301 305
302 snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware); 306 snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware);
303 return 0; 307 return 0;