|
@@ -292,12 +292,16 @@ static int snd_imx_open(struct snd_pcm_substream *substream)
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
iprtd = kzalloc(sizeof(*iprtd), GFP_KERNEL);
|
|
iprtd = kzalloc(sizeof(*iprtd), GFP_KERNEL);
|
|
|
|
+ if (iprtd == NULL)
|
|
|
|
+ return -ENOMEM;
|
|
runtime->private_data = iprtd;
|
|
runtime->private_data = iprtd;
|
|
|
|
|
|
ret = snd_pcm_hw_constraint_integer(substream->runtime,
|
|
ret = snd_pcm_hw_constraint_integer(substream->runtime,
|
|
SNDRV_PCM_HW_PARAM_PERIODS);
|
|
SNDRV_PCM_HW_PARAM_PERIODS);
|
|
- if (ret < 0)
|
|
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ kfree(iprtd);
|
|
return ret;
|
|
return ret;
|
|
|
|
+ }
|
|
|
|
|
|
snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware);
|
|
snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware);
|
|
return 0;
|
|
return 0;
|