1
0
Fork 0

MLK-11915-11 ASoC: fsl_asrc_dma: check the return value for snd_pcm_hw_constraint_integer()

check the return value for snd_pcm_hw_constraint_integer().
Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 26f8fea617fcebd8835f660534a988c58b9f0517)
pull/10/head
Zidan Wang 2015-11-27 13:45:09 +08:00 committed by Jason Liu
parent 085303d6fa
commit 48d8d772d9
1 changed files with 7 additions and 2 deletions

View File

@ -293,6 +293,7 @@ static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream)
struct device *dev = rtd->platform->dev;
struct fsl_asrc *asrc_priv = dev_get_drvdata(dev);
struct fsl_asrc_pair *pair;
int ret;
pair = kzalloc(sizeof(struct fsl_asrc_pair), GFP_KERNEL);
if (!pair)
@ -302,8 +303,12 @@ static int fsl_asrc_dma_startup(struct snd_pcm_substream *substream)
runtime->private_data = pair;
snd_pcm_hw_constraint_integer(substream->runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
ret = snd_pcm_hw_constraint_integer(substream->runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
if (ret < 0) {
dev_err(dev, "failed to set pcm hw params periods\n");
return ret;
}
snd_soc_set_runtime_hwparams(substream, &snd_imx_hardware);
return 0;