[alsa-devel] Alsa 1.0.15rc2 and oops with Dell M1210

Herton Ronaldo Krzesinski herton at mandriva.com.br
Wed Oct 10 20:21:20 CEST 2007


Em Tuesday 09 October 2007 06:55:32 Takashi Iwai escreveu:
> 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.

Yes, the patch was reported to me as working fine, thanks.

>
>
> 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;

--
[]'s
Herton


More information about the Alsa-devel mailing list