Skip to content

Commit 2152ee7

Browse files
perexgSasha Levin
authored and
Sasha Levin
committed
ALSA: hda - fix the 'Capture Switch' value change notifications
[ Upstream commit a2befe9 ] The original code in the cap_put_caller() function does not handle correctly the positive values returned from the passed function for multiple iterations. It means that the change notifications may be lost. Fixes: 352f7f9 ("ALSA: hda - Merge Realtek parser code to generic parser") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213851 Cc: <[email protected]> Signed-off-by: Jaroslav Kysela <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 8681e95 commit 2152ee7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sound/pci/hda/hda_generic.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3460,7 +3460,7 @@ static int cap_put_caller(struct snd_kcontrol *kcontrol,
34603460
struct hda_gen_spec *spec = codec->spec;
34613461
const struct hda_input_mux *imux;
34623462
struct nid_path *path;
3463-
int i, adc_idx, err = 0;
3463+
int i, adc_idx, ret, err = 0;
34643464

34653465
imux = &spec->input_mux;
34663466
adc_idx = kcontrol->id.index;
@@ -3470,9 +3470,13 @@ static int cap_put_caller(struct snd_kcontrol *kcontrol,
34703470
if (!path || !path->ctls[type])
34713471
continue;
34723472
kcontrol->private_value = path->ctls[type];
3473-
err = func(kcontrol, ucontrol);
3474-
if (err < 0)
3473+
ret = func(kcontrol, ucontrol);
3474+
if (ret < 0) {
3475+
err = ret;
34753476
break;
3477+
}
3478+
if (ret > 0)
3479+
err = 1;
34763480
}
34773481
mutex_unlock(&codec->control_mutex);
34783482
if (err >= 0 && spec->cap_sync_hook)

0 commit comments

Comments
 (0)