aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-12-27 05:24:56 -0500
committerTakashi Iwai <tiwai@suse.de>2009-12-27 07:39:25 -0500
commitb82855a0d76ebda1cc14c00040560d77bfa042ce (patch)
treee10bb6a0586e32ed4e44bfd381bc28d6807acb6e /sound/pci/hda/hda_codec.c
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>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-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,
824 struct hda_pincfg *pin; 824 struct hda_pincfg *pin;
825 unsigned int oldcfg; 825 unsigned int oldcfg;
826 826
827 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
828 return -EINVAL;
829
827 oldcfg = snd_hda_codec_get_pincfg(codec, nid); 830 oldcfg = snd_hda_codec_get_pincfg(codec, nid);
828 pin = look_up_pincfg(codec, list, nid); 831 pin = look_up_pincfg(codec, list, nid);
829 if (!pin) { 832 if (!pin) {