]> www.infradead.org Git - users/jedix/linux-maple.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)
committerTakashi Iwai <tiwai@suse.de>
Tue, 6 Aug 2024 16:27:08 +0000 (18:27 +0200)
commit901e85677ec0bb9a69fb9eab1feafe0c4eb7d07e
tree85df0b1e4caa8ec18eed26d89f8c7d81ec72a8a2
parent0079c9d1e58a39148e6ce13bda55307ea6aa3a9e
ALSA: usb-audio: Add input value sanity checks for standard types

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>
sound/usb/mixer.c
sound/usb/mixer.h