summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-12-27 11:24:56 +0100
committerTakashi Iwai <tiwai@suse.de>2009-12-27 13:39:25 +0100
commitb82855a0d76ebda1cc14c00040560d77bfa042ce (patch)
treee10bb6a0586e32ed4e44bfd381bc28d6807acb6e
parenta4e09aa3cf592d9f084ff4ceb216be40c4c265dc (diff)
ALSA: hda - Add sanity check for storing the user-defined pin configs
Check whether the given NID is a pin widget before storing the user-defined pin configs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_codec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 94ae69f20925..d02ea8926e7e 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -824,6 +824,9 @@ int snd_hda_add_pincfg(struct hda_codec *codec, struct snd_array *list,
struct hda_pincfg *pin;
unsigned int oldcfg;
+ if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
+ return -EINVAL;
+
oldcfg = snd_hda_codec_get_pincfg(codec, nid);
pin = look_up_pincfg(codec, list, nid);
if (!pin) {