projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb80b96
)
ALSA: usb-audio: Don't create a mixer element with bogus volume range
author
Takashi Iwai
<tiwai@suse.de>
Fri, 14 Feb 2020 14:49:28 +0000
(15:49 +0100)
committer
Takashi Iwai
<tiwai@suse.de>
Fri, 14 Feb 2020 14:51:35 +0000
(15:51 +0100)
Some USB-audio descriptors provide a bogus volume range (e.g. volume
min and max are identical), which confuses user-space.
This patch makes the driver skipping such a control element.
BugLink:
https://bugzilla.kernel.org/show_bug.cgi?id=206221
Link:
https://lore.kernel.org/r/20200214144928.23628-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/mixer.c
patch
|
blob
|
history
diff --git
a/sound/usb/mixer.c
b/sound/usb/mixer.c
index d659fdb475e2bc373941df884b0404364cfb534b..96e20488804d1c5202d9883fd05b1cad0e0def2d 100644
(file)
--- a/
sound/usb/mixer.c
+++ b/
sound/usb/mixer.c
@@
-1666,6
+1666,16
@@
static void __build_feature_ctl(struct usb_mixer_interface *mixer,
/* get min/max values */
get_min_max_with_quirks(cval, 0, kctl);
+ /* skip a bogus volume range */
+ if (cval->max <= cval->min) {
+ usb_audio_dbg(mixer->chip,
+ "[%d] FU [%s] skipped due to invalid volume\n",
+ cval->head.id, kctl->id.name);
+ snd_ctl_free_one(kctl);
+ return;
+ }
+
+
if (control == UAC_FU_VOLUME) {
check_mapped_dB(map, cval);
if (cval->dBmin < cval->dBmax || !cval->initialized) {