[ALSA] hda-codec - Don't query widget parameter for invalid NID

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, January 31, 2008 - 5:04 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dca008...
Commit:     dca008f367586f73bd1c766836e4f7a38ce9814f
Parent:     0ef6ce7b6acddc3dc9e898125b3bada98a21130a
Author:     Takashi Iwai <tiwai@suse.de>
AuthorDate: Tue Jan 22 15:37:13 2008 +0100
Committer:  Jaroslav Kysela <perex@perex.cz>
CommitDate: Thu Jan 31 17:30:10 2008 +0100

    [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>
---
 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 ddc61a1..448c4ce 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];
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[ALSA] hda-codec - Don't query widget parameter for invali ..., Linux Kernel Mailing ..., (Thu Jan 31, 5:04 pm)