diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2008-08-26 05:06:26 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-08-26 06:43:13 -0400 |
commit | 3d839e5b87a70effc629c1cdbf77d837ef141919 (patch) | |
tree | 9818c65b8a7fcc97ecb4faf2e614464dfcea2fd3 /sound | |
parent | b8e6c91c74e9f0279b7c51048779b3d62da60b88 (diff) |
ALSA: oxygen: prevent muting of nonexistent AC97 controls
The Xonar DX does not have CD Capture controls, so we have to check that
a control actually exists before muting it.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/oxygen/oxygen_mixer.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index 6facac5aed90..05eb8994c141 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c | |||
@@ -512,9 +512,12 @@ static int ac97_switch_get(struct snd_kcontrol *ctl, | |||
512 | 512 | ||
513 | static void mute_ac97_ctl(struct oxygen *chip, unsigned int control) | 513 | static void mute_ac97_ctl(struct oxygen *chip, unsigned int control) |
514 | { | 514 | { |
515 | unsigned int priv_idx = chip->controls[control]->private_value & 0xff; | 515 | unsigned int priv_idx; |
516 | u16 value; | 516 | u16 value; |
517 | 517 | ||
518 | if (!chip->controls[control]) | ||
519 | return; | ||
520 | priv_idx = chip->controls[control]->private_value & 0xff; | ||
518 | value = oxygen_read_ac97(chip, 0, priv_idx); | 521 | value = oxygen_read_ac97(chip, 0, priv_idx); |
519 | if (!(value & 0x8000)) { | 522 | if (!(value & 0x8000)) { |
520 | oxygen_write_ac97(chip, 0, priv_idx, value | 0x8000); | 523 | oxygen_write_ac97(chip, 0, priv_idx, value | 0x8000); |