diff options
author | Takashi Iwai <tiwai@suse.de> | 2024-08-06 15:46:50 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-10 13:03:18 +0300 |
commit | 570cd8d381830593165893b0e008f9ad579942ee (patch) | |
tree | 10d8e1415b5f68051a3d5479d0b1d75d1438ceae /sound/usb/mixer.h | |
parent | 57b28827de3742a44bba27d93c25b7f8f49a25bd (diff) | |
download | linux-570cd8d381830593165893b0e008f9ad579942ee.tar.xz |
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>
Diffstat (limited to 'sound/usb/mixer.h')
-rw-r--r-- | sound/usb/mixer.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h index d43895c1ae5c..167fbfcf01ac 100644 --- a/sound/usb/mixer.h +++ b/sound/usb/mixer.h @@ -88,6 +88,7 @@ struct usb_mixer_elem_info { int channels; int val_type; int min, max, res; + int max_exposed; /* control API exposes the value in 0..max_exposed */ int dBmin, dBmax; int cached; int cache_val[MAX_CHANNELS]; |