Commit c51def65 authored by Lu Guanqun's avatar Lu Guanqun Committed by Mark Brown

ASoC: fix config error path

initialize ret to invalid value so that when we reach the config error path in
soc_pcm_open, it will return the correct error code. without this patch, though
config error path is executed, soc_pcm_open will return 0 in
snd_pcm_open_substream and then cause double release of substream.
Signed-off-by: default avatarLu Guanqun <guanqun.lu@intel.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent b04cfcf7
...@@ -629,6 +629,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) ...@@ -629,6 +629,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
runtime->hw.rates |= codec_dai_drv->capture.rates; runtime->hw.rates |= codec_dai_drv->capture.rates;
} }
ret = -EINVAL;
snd_pcm_limit_hw_rates(runtime); snd_pcm_limit_hw_rates(runtime);
if (!runtime->hw.rates) { if (!runtime->hw.rates) {
printk(KERN_ERR "asoc: %s <-> %s No matching rates\n", printk(KERN_ERR "asoc: %s <-> %s No matching rates\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment