From: Takashi Iwai Subject: Re: [ASoC] bug in soc_pcm_open Date: Tue, 12 Jun 2007 14:55:42 +0200 Message-ID: References: <8d6898730706111344x6a6f53e1n4a21d8b93da83f70@mail.gmail.com> <8d6898730706112251j6226601bia95c1596ef655582@mail.gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (ns2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 5F814103847 for ; Tue, 12 Jun 2007 14:55:51 +0200 (CEST) In-Reply-To: <8d6898730706112251j6226601bia95c1596ef655582@mail.gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Nobin Mathew Cc: alsa-devel@alsa-project.org, Matthieu CASTET List-Id: alsa-devel@alsa-project.org 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",