Skip to content

Commit 9d2b48f

Browse files
committed
ALSA: hda - Check all inputs for is_active_nid_for_any()
The is_active_nid_for_any() function in the generic parser is supposed to check all connections from/to the given widget, but the current code checks only the first input connection (index = 0). This patch corrects the code to check all inputs by passing -1 to index argument. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=102521 Cc: <stable@vger.kernel.org> [v4.1+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent c7e69ae commit 9d2b48f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sound/pci/hda/hda_generic.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,8 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid,
671671
}
672672
for (i = 0; i < path->depth; i++) {
673673
if (path->path[i] == nid) {
674-
if (dir == HDA_OUTPUT || path->idx[i] == idx)
674+
if (dir == HDA_OUTPUT || idx == -1 ||
675+
path->idx[i] == idx)
675676
return true;
676677
break;
677678
}
@@ -682,7 +683,7 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid,
682683

683684
/* check whether the NID is referred by any active paths */
684685
#define is_active_nid_for_any(codec, nid) \
685-
is_active_nid(codec, nid, HDA_OUTPUT, 0)
686+
is_active_nid(codec, nid, HDA_OUTPUT, -1)
686687

687688
/* get the default amp value for the target state */
688689
static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid,

0 commit comments

Comments
 (0)