]> xenbits.xensource.com Git - linux-pvops.git/commitdiff
ALSA: ice1724 - Check for ac97 to avoid kernel oops
authorPavel Hofman <pavel.hofman@ivitera.com>
Thu, 5 Jan 2012 22:05:18 +0000 (23:05 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 25 Jan 2012 21:53:18 +0000 (13:53 -0800)
commit e7848163aa2a649d9065f230fadff80dc3519775 upstream.

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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/pci/ice1712/amp.c

index 6da21a2bcade940c9104bdcbd5ad85972d5eb468..95873b54e4870995b0d65fb366540ccc5311e7f3 100644 (file)
@@ -69,8 +69,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;
 }