[alsa-devel] [ASoC] bug in soc_pcm_open

Takashi Iwai tiwai at suse.de
Tue Jun 12 14:55:42 CEST 2007


At Tue, 12 Jun 2007 11:21:47 +0530,
Nobin Mathew wrote:
> 
> Same will cause problems in ALSA also, because nobody is checking
> whether channel_min/max is zero; it is used in pcm_native.c
> 
> http://mailman.alsa-project.org/pipermail/alsa-devel/2007-June/001400.html

Yes, ALSA core layer assumes that the driver shall pass the correct
value.  Does the patch like below fix the problem?


(BTW, it'd be aprreciated if you can avoid top-citation...)

Takashi

diff -r 640ed49a540d soc/soc-core.c
--- a/soc/soc-core.c	Tue Jun 12 11:27:46 2007 +0200
+++ b/soc/soc-core.c	Tue Jun 12 14:52:25 2007 +0200
@@ -213,6 +213,7 @@ static int soc_pcm_open(struct snd_pcm_s
 			codec_dai->capture.rates & cpu_dai->capture.rates;
 	}
 
+	ret = -EINVAL; /* passed to machine_err */
 	snd_pcm_limit_hw_rates(runtime);
 	if (!runtime->hw.rates) {
 		printk(KERN_ERR "asoc: %s <-> %s No matching rates\n",


More information about the Alsa-devel mailing list