summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2009-07-22 16:20:40 +0200
committerTakashi Iwai <tiwai@suse.de>2009-07-22 16:30:03 +0200
commit16a433d8b38720a816736d59a62e705c19e31600 (patch)
treeec2efc9b071b2fc7b68d9a0278a9f64d997d7af1 /sound/pci/hda/hda_codec.c
parent254da007f93f79ee773788cbb38f24dfab9590f5 (diff)
ALSA: hda-intel: Cleanups for widget connection list handling
This patch adds a check to snd_hda_get_connections() routine for presence of AC_WCAP_CONN_LIST. Also, make sure that negative error codes from noted route are handled on all places as errors. Signed-off-by: Jaroslav Kysela <perex@perex.cz> 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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 3ecb45ddadf7..aa5540786111 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -306,6 +306,12 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid,
if (snd_BUG_ON(!conn_list || max_conns <= 0))
return -EINVAL;
+ if ((get_wcaps(codec, nid) & AC_WCAP_CONN_LIST) == 0) {
+ snd_printk(KERN_WARNING "hda_codec: "
+ "connection list not available for 0x%x\n", nid);
+ return -EINVAL;
+ }
+
parm = snd_hda_param_read(codec, nid, AC_PAR_CONNLIST_LEN);
if (parm & AC_CLIST_LONG) {
/* long form */