diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-08-20 09:19:59 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-08-20 09:24:54 +0200 |
commit | 1b004d03d8670bdd871e0f297ed20bc510e404de (patch) | |
tree | ad1df1f55b8b3a004907ceada35c1c185b35461e | |
parent | b6acf013bdc6f6ff9643030add85832d44034a28 (diff) |
ALSA: hda - Fix error check from snd_hda_get_conn_index() in patch_cirrus.c
snd_hda_get_conn_index() returns a negative value while the current code
stores it in an unsigned int. It must be stored in a signed integer.
Reported-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_cirrus.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 47d6ffc9b5b..d6c93d92b55 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c @@ -375,7 +375,7 @@ static int is_ext_mic(struct hda_codec *codec, unsigned int idx) static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin, unsigned int *idxp) { - int i; + int i, idx; hda_nid_t nid; nid = codec->start_nid; @@ -384,9 +384,11 @@ static hda_nid_t get_adc(struct hda_codec *codec, hda_nid_t pin, type = get_wcaps_type(get_wcaps(codec, nid)); if (type != AC_WID_AUD_IN) continue; - *idxp = snd_hda_get_conn_index(codec, nid, pin, false); - if (*idxp >= 0) + idx = snd_hda_get_conn_index(codec, nid, pin, false); + if (idx >= 0) { + *idxp = idx; return nid; + } } return 0; } |