Skip to content

Commit

Permalink
ALSA: ice1724 - Check for ac97 to avoid kernel oops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Hofman authored and Takashi Iwai committed Jan 8, 2012
1 parent dcc2cf7 commit e784816
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sound/pci/ice1712/amp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e784816

Please sign in to comment.