android_kernel_samsung_msm8976/sound/usb
Takashi Iwai 5ebcb3c532 ALSA: usb-audio: Fix the missing ctl name suffix at parsing SU
commit 5a15f289ee87eaf33f13f08a4909ec99d837ec5f upstream.

The commit 89b89d121ffc ("ALSA: usb-audio: Add check return value for
usb_string()") added the check of the return value from
snd_usb_copy_string_desc(), which is correct per se, but it introduced
a regression.  In the original code, either the "Clock Source",
"Playback Source" or "Capture Source" suffix is added after the
terminal string, while the commit changed it to add the suffix only
when get_term_name() is failing.  It ended up with an incorrect ctl
name like "PCM" instead of "PCM Capture Source".

Also, even the original code has a similar bug: when the ctl name is
generated from snd_usb_copy_string_desc() for the given iSelector, it
also doesn't put the suffix.

This patch addresses these issues: the suffix is added always when no
static mapping is found.  Also the patch tries to put more comments
and cleans up the if/else block for better readability in order to
avoid the same pitfall again.

Fixes: 89b89d121ffc ("ALSA: usb-audio: Add check return value for usb_string()")
Reported-and-tested-by: Mauro Santos <registo.mailling@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:46:20 +02:00
..
6fire
caiaq
misc
usx2y
card.c ALSA: usb-audio: Fix bogus error return in snd_usb_create_stream() 2019-07-27 21:42:55 +02:00
card.h
clock.c ALSA: usb-audio: Add sanity checks in v2 clock parsers 2019-07-27 21:46:06 +02:00
clock.h
debug.h
endpoint.c Merge tag 'LA.BR.1.3.6-03510-8976.0' into HEAD 2017-04-18 12:11:50 +02:00
endpoint.h
format.c
format.h
helper.c
helper.h
Kconfig
Makefile
midi.c This is the 3.10.94 stable release 2017-04-18 17:12:56 +02:00
midi.h
mixer.c ALSA: usb-audio: Fix the missing ctl name suffix at parsing SU 2019-07-27 21:46:20 +02:00
mixer.h ALSA: usb-audio: Kill stray URB at exiting 2018-08-20 12:15:26 +02:00
mixer_maps.c
mixer_quirks.c
mixer_quirks.h
pcm.c Merge tag 'LA.BR.1.3.6-03510-8976.0' into HEAD 2017-04-18 12:11:50 +02:00
pcm.h
power.h
proc.c
proc.h
quirks-table.h
quirks.c This is the 3.10.97 stable release 2017-04-18 17:17:20 +02:00
quirks.h
stream.c ALSA: usb-audio: Fix double-free in error paths after snd_usb_add_audio_stream() call 2016-11-19 20:31:43 -08:00
stream.h
usbaudio.h