diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-01-22 09:37:13 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:30:10 -0500 |
commit | dca008f367586f73bd1c766836e4f7a38ce9814f (patch) | |
tree | 174bdb00bf674b21251df8e6c1a2ecc30f08ddd5 | |
parent | 0ef6ce7b6acddc3dc9e898125b3bada98a21130a (diff) |
[ALSA] hda-codec - Don't query widget parameter for invalid NID
Don't query a widget parameter for an invalid NID in get_wcaps() but
rather returns zero (i.e. no attribute).
The read to an non-existing widget may result in a fatal codec
communication error.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | sound/pci/hda/hda_local.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index ddc61a1d1153..448c4ce816c3 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -370,7 +370,7 @@ static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid) | |||
370 | { | 370 | { |
371 | if (nid < codec->start_nid || | 371 | if (nid < codec->start_nid || |
372 | nid >= codec->start_nid + codec->num_nodes) | 372 | nid >= codec->start_nid + codec->num_nodes) |
373 | return snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP); | 373 | return 0; |
374 | return codec->wcaps[nid - codec->start_nid]; | 374 | return codec->wcaps[nid - codec->start_nid]; |
375 | } | 375 | } |
376 | 376 | ||