summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorZidan Wang <zidan.wang@freescale.com>2015-11-27 13:45:09 +0800
committerNitin Garg <nitin.garg@nxp.com>2016-01-14 11:02:29 -0600
commitc9d480c5f4f52834e61dc075c2fc894907d5d0ef (patch)
treee2b76ad36c251574fd13bbbccd88881beec2a4af /sound
parent482009ecdcd0efd47fa645c03677f3101c514a13 (diff)
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)
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_asrc_dma.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
index f0bf0b6657f5..e5b9bfb070bb 100644
--- a/sound/soc/fsl/fsl_asrc_dma.c
+++ b/sound/soc/fsl/fsl_asrc_dma.c
@@ -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) {
@@ -304,8 +305,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;