summaryrefslogtreecommitdiff
path: root/sound/pci/ice1712
diff options
context:
space:
mode:
authorPavel Hofman <pavel.hofman@ivitera.com>2012-01-06 02:05:18 +0400
committerTakashi Iwai <tiwai@suse.de>2012-01-08 17:26:01 +0400
commite7848163aa2a649d9065f230fadff80dc3519775 (patch)
tree65da3f5778dd6f2ff311c34306b38bd3849493b1 /sound/pci/ice1712
parentdcc2cf7507861476c874cc7974e5d4557a32475f (diff)
downloadlinux-e7848163aa2a649d9065f230fadff80dc3519775.tar.xz
ALSA: ice1724 - Check for ac97 to avoid kernel oops
Cards with identical PCI ids but no AC97 config in EEPROM do not have the ac97 field initialized. We must check for this case to avoid kernel oops. Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ice1712')
-rw-r--r--sound/pci/ice1712/amp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/pci/ice1712/amp.c b/sound/pci/ice1712/amp.c
index e328cfb7620c..e525da2673be 100644
--- a/sound/pci/ice1712/amp.c
+++ b/sound/pci/ice1712/amp.c
@@ -68,8 +68,11 @@ static int __devinit snd_vt1724_amp_init(struct snd_ice1712 *ice)
static int __devinit snd_vt1724_amp_add_controls(struct snd_ice1712 *ice)
{
- /* we use pins 39 and 41 of the VT1616 for left and right read outputs */
- snd_ac97_write_cache(ice->ac97, 0x5a, snd_ac97_read(ice->ac97, 0x5a) & ~0x8000);
+ if (ice->ac97)
+ /* we use pins 39 and 41 of the VT1616 for left and right
+ read outputs */
+ snd_ac97_write_cache(ice->ac97, 0x5a,
+ snd_ac97_read(ice->ac97, 0x5a) & ~0x8000);
return 0;
}