]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: usb-audio: Add input value sanity checks for standard types
authorTakashi Iwai <tiwai@suse.de>
Tue, 6 Aug 2024 12:46:50 +0000 (14:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:27 +0000 (15:11 +0200)
commit8af3e93c5a95370a7d3babf62a717663bdbb0b71
tree47de414ebba24fabfcd86430fa339563af80c5f7
parent4631445ce6339097bcc2bfc781024ff818658d2b
ALSA: usb-audio: Add input value sanity checks for standard types

[ Upstream commit 901e85677ec0bb9a69fb9eab1feafe0c4eb7d07e ]

For an invalid input value that is out of the given range, currently
USB-audio driver corrects the value silently and accepts without
errors.  This is no wrong behavior, per se, but the recent kselftest
rather wants to have an error in such a case, hence a different
behavior is expected now.

This patch adds a sanity check at each control put for the standard
mixer types and returns an error if an invalid value is given.

Note that this covers only the standard mixer types.  The mixer quirks
that have own control callbacks would need different coverage.

Link: https://patch.msgid.link/20240806124651.28203-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/usb/mixer.c
sound/usb/mixer.h