diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-12-27 10:24:56 (GMT) |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-12-27 12:39:25 (GMT) |
commit | b82855a0d76ebda1cc14c00040560d77bfa042ce (patch) | |
tree | e10bb6a0586e32ed4e44bfd381bc28d6807acb6e | |
parent | a4e09aa3cf592d9f084ff4ceb216be40c4c265dc (diff) | |
download | linux-fsl-qoriq-b82855a0d76ebda1cc14c00040560d77bfa042ce.tar.xz |
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 94ae69f..d02ea89 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) { |