From: Takashi Iwai Date: Tue, 22 Jan 2008 14:37:13 +0000 (+0100) Subject: [ALSA] hda-codec - Don't query widget parameter for invalid NID X-Git-Tag: v2.6.25-rc1~1127^2~52 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dca008f367586f73bd1c766836e4f7a38ce9814f;p=linux-2.6 [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 Signed-off-by: Jaroslav Kysela --- diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index ddc61a1d11..448c4ce816 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) { if (nid < codec->start_nid || nid >= codec->start_nid + codec->num_nodes) - return snd_hda_param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP); + return 0; return codec->wcaps[nid - codec->start_nid]; }