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>
{
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];
}