ALSA: hda - fix the 'Capture Switch' value change notifications
Jaroslav Kysela
maintainerPATCH 1/1 ALSA: hda - fix the 'Capture Switch' value change notifications
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 352f7f914ebb ("ALSA: hda - Merge Realtek parser code to generic parser")
Cc <[email protected]>
Signed-off-by Jaroslav Kysela <[email protected]>
--- sound/pci/hda/hda_generic.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
sound/pci/hda/hda_generic.c +7 -3
@@ -3460,7 +3460,7 @@ static int cap_put_caller(struct snd_kcontrol *kcontrol,struct hda_gen_spec *spec = codec->spec;const struct hda_input_mux *imux;struct nid_path *path; -int i, adc_idx, err =0 ; +int i, adc_idx, ret, err =0 ; imux = &spec->input_mux; adc_idx = kcontrol->id.index;
@@ -3470,9 +3470,13 @@ static int cap_put_caller(struct snd_kcontrol *kcontrol,if (!path || !path->ctls[type])continue ; kcontrol->private_value = path->ctls[type]; - err =func (kcontrol, ucontrol); -if (err <0 ) + ret =func (kcontrol, ucontrol); +if (ret <0 ) { + err = ret;break ; + } +if (ret >0 ) + err =1 ; }mutex_unlock (&codec->control_mutex);if (err >=0 && spec->cap_sync_hook)
Signature · 1 line
2.31.1
Takashi Iwai
AppliedQuoted 10 lines · Jaroslav Kysela
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 352f7f914ebb ("ALSA: hda - Merge Realtek parser code to generic parser")Cc <[email protected]>Signed-off-by Jaroslav Kysela <[email protected]>
Thanks, applied.
Takashi