diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-01-10 06:41:22 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-01-10 06:41:22 -0500 |
commit | 3a90274de3548ebb2aabfbf488cea8e275a73dc6 (patch) | |
tree | 062bf3d12a3db01de80533b58f25a0eac6149060 /sound/pci/hda/hda_proc.c | |
parent | de4da59e480cdf1075b33dbaf8078fc87bc52241 (diff) |
ALSA: hda - Return the error from get_wcaps_type() for invalid NIDs
When an invalid NID is given, get_wcaps() returns zero as the error,
but get_wcaps_type() takes it as the normal value and returns a bogus
AC_WID_AUD_OUT value. This confuses the parser.
With this patch, get_wcaps_type() returns -1 when value 0 is given,
i.e. an invalid NID is passed to get_wcaps().
Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=740118
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_proc.c')
-rw-r--r-- | sound/pci/hda/hda_proc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index 2c981b55940b..254ab5204603 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c | |||
@@ -54,6 +54,8 @@ static const char *get_wid_type_name(unsigned int wid_value) | |||
54 | [AC_WID_BEEP] = "Beep Generator Widget", | 54 | [AC_WID_BEEP] = "Beep Generator Widget", |
55 | [AC_WID_VENDOR] = "Vendor Defined Widget", | 55 | [AC_WID_VENDOR] = "Vendor Defined Widget", |
56 | }; | 56 | }; |
57 | if (wid_value == -1) | ||
58 | return "UNKNOWN Widget"; | ||
57 | wid_value &= 0xf; | 59 | wid_value &= 0xf; |
58 | if (names[wid_value]) | 60 | if (names[wid_value]) |
59 | return names[wid_value]; | 61 | return names[wid_value]; |