Re: [PATCH] ALSA: hda: reject invalid values in the IEC958 switch put callbacks
From: Takashi Iwai
Date: Tue Nov 24 2026 - 07:51:05 EST
On Mon, 23 Nov 2026 18:02:01 +0100,
Arnav Kapoor wrote:
>
> snd_hda_spdif_out_switch_put(), snd_hda_spdif_in_switch_put() and
> spdif_share_sw_put() treat any non-zero value as "on", so writes of
> values outside 0..1, such as 2, -1 or INT_MAX, to these boolean
> controls succeed instead of being rejected. snd_hda_mixer_amp_switch_put()
> in the same file already returns -EINVAL for them.
>
> Check the value in the same way before taking spdif_mutex.
>
> Signed-off-by: Arnav Kapoor <kapoorarnav43@xxxxxxxxx>
Applied to for-next branch now. Thanks.
Takashi