From c51def659870d25c735a9e06648e560ab39dbbb6 Mon Sep 17 00:00:00 2001 From: Lu Guanqun Date: Wed, 6 Apr 2011 23:25:21 +0800 Subject: 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: Lu Guanqun Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4f42fef26c98..d8562ce4de7a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -629,6 +629,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) runtime->hw.rates |= codec_dai_drv->capture.rates; } + ret = -EINVAL; snd_pcm_limit_hw_rates(runtime); if (!runtime->hw.rates) { printk(KERN_ERR "asoc: %s <-> %s No matching rates\n", -- cgit v1.2.3