From: Takashi Iwai Subject: Re: Alsa 1.0.15rc2 and oops with Dell M1210 Date: Tue, 09 Oct 2007 11:55:32 +0200 Message-ID: References: <1191056837.4984.12.camel@localhost.localdomain> <200709291853.29592.herton@mandriva.com.br> <200710031658.35289.herton@mandriva.com.br> 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 5393924652 for ; Tue, 9 Oct 2007 11:55:33 +0200 (CEST) In-Reply-To: <200710031658.35289.herton@mandriva.com.br> 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: Herton Ronaldo Krzesinski Cc: zhejiang , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Wed, 3 Oct 2007 16:58:35 -0300, Herton Ronaldo Krzesinski wrote: > > Em Saturday 29 September 2007 18:53:29 Herton Ronaldo Krzesinski escreveu: > > On Saturday 29 September 2007 06:07:17 zhejiang wrote: > > > Seems that the spec->input_mux contains no item at all. > > > So system maybe crash in the snd_hda_input_mux_info() when try to copy > > > the items[].label,which is null pointer. > > > > > > May you replace the function stac92xx_mux_enum_info() in > > > alsa-driver-1.0.15rc2/alsa-kernel/pci/hda/patch_sigmatel.c ? > > > > > > static int stac92xx_mux_enum_info(struct snd_kcontrol *kcontrol, struct > > > snd_ctl_elem_info *uinfo) > > > { > > > struct hda_codec *codec = snd_kcontrol_chip(kcontrol); > > > struct sigmatel_spec *spec = codec->spec; > > > printk("spec->input_mux->num_items is %d > > > \n",spec->input_mux->num_items); > > > if(!spec->input_mux->num_items) > > > return 0; > > > return snd_hda_input_mux_info(spec->input_mux, uinfo); > > > } > > > > > > Does it still crash? > > > What's the number of num_items? > > I received feedback from the reporter: > spec->input_mux->num_items is 0 > > Also sound works fine, no more crashes. OK, then could you check whether the patch below fixes the problem? Such a check should be done in the common routine. Thanks, Takashi diff -r a4cf3aa3dc5b pci/hda/hda_codec.c --- a/pci/hda/hda_codec.c Tue Oct 09 10:34:06 2007 +0200 +++ b/pci/hda/hda_codec.c Tue Oct 09 11:53:39 2007 +0200 @@ -2341,6 +2341,8 @@ int snd_hda_input_mux_info(const struct uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; uinfo->count = 1; uinfo->value.enumerated.items = imux->num_items; + if (!imux->num_items) + return 0; index = uinfo->value.enumerated.item; if (index >= imux->num_items) index = imux->num_items - 1; @@ -2356,6 +2358,8 @@ int snd_hda_input_mux_put(struct hda_cod { unsigned int idx; + if (!imux->num_items) + return 0; idx = ucontrol->value.enumerated.item[0]; if (idx >= imux->num_items) idx = imux->num_items - 1;