-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jiri Slaby wrote:
Ok, the problem was that codec->slave_dig_outs getting a dereference when NULL.
This has been already fixed in Takashi's sound-2.6.git tree, with the commit id
06efc354f735d5dbbdf4653fc6a8acd489ac5a18.
Thanks,
Matt Ranostay
- ---
# git log pci/hda/hda_codec.c
...
commit 06efc354f735d5dbbdf4653fc6a8acd489ac5a18
Author: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Date: Sat Sep 13 16:44:29 2008 +0200
ALSA: hda: fix oopses in snd-hda-intel after digital slave support additions
Many places fail to check if codec has slave_dig_outs entries (the most common
case is not having any entry), leading to various possible oopses in hda_codec
code.
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
...
# git diff af41e1693fdaa7a3e25cc8dd1ff3180f83487e5a 06efc354f735d5dbbdf4653fc6a8acd489ac5a18 pci/hda/hda_codec.c
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index c4fc0d4..0707a8e 100644
- --- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1457,14 +1457,15 @@ static int snd_hda_spdif_default_put(struct snd_kcontrol *kcontrol,
AC_VERB_SET_DIGI_CONVERT_2,
val >> 8);
- - for (d = codec->slave_dig_outs; *d; d++) {
- - snd_hda_codec_write_cache(codec, *d, 0,
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++) {
+ snd_hda_codec_write_cache(codec, *d, 0,
AC_VERB_SET_DIGI_CONVERT_1,
val & 0xff);
- - snd_hda_codec_write_cache(codec, *d, 0,
+ snd_hda_codec_write_cache(codec, *d, 0,
AC_VERB_SET_DIGI_CONVERT_2,
val >> 8);
- - }
+ }
}
mutex_unlock(&codec->spdif_mutex);
@@ -1502,8 +1503,9 @@ static int snd_hda_spdif_out_switch_put(struct snd_kcontrol *kcontrol,
AC_VERB_SET_DIGI_CONVERT_1,
val & 0xff);
- - for (d = codec->slave_dig_outs; *d; d++)
- - snd_hda_codec_write_cache(codec, *d, 0,
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write_cache(codec, *d, 0,
AC_VERB_SET_DIGI_CONVERT_1,
val & 0xff);
/* unmute amp switch (if any) */
@@ -1659,8 +1661,9 @@ static int snd_hda_spdif_in_switch_put(struct snd_kcontrol *kcontrol,
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_DIGI_CONVERT_1, val);
- - for (d = codec->slave_dig_outs; *d; d++)
- - snd_hda_codec_write_cache(codec, *d, 0,
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write_cache(codec, *d, 0,
AC_VERB_SET_DIGI_CONVERT_1, val);
}
mutex_unlock(&codec->spdif_mutex);
@@ -2610,9 +2613,10 @@ static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
- - for (d = codec->slave_dig_outs; *d; d++)
- - snd_hda_codec_write(codec, *d, 0,
- - AC_VERB_SET_DIGI_CONVERT_1,
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & ~AC_DIG1_ENABLE & 0xff);
}
snd_hda_codec_setup_stream(codec, nid, stream_tag, 0, format);
@@ -2621,9 +2625,10 @@ static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & 0xff);
- - for (d = codec->slave_dig_outs; *d; d++)
- - snd_hda_codec_write(codec, *d, 0,
- - AC_VERB_SET_DIGI_CONVERT_1,
+ if (codec->slave_dig_outs)
+ for (d = codec->slave_dig_outs; *d; d++)
+ snd_hda_codec_write(codec, *d, 0,
+ AC_VERB_SET_DIGI_CONVERT_1,
codec->spdif_ctls & 0xff);
}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iEYEARECAAYFAkjRD48ACgkQ7s2wy7nhBHWlwwCgn3aWMATxTWYnMnnAhAE8NjzE
sEoAn0GIFSiv2Y0RugBFyi00MVYHNmu5
=DLwd
-----END PGP SIGNATURE-----
--