linux-brain/sound/usb
Takashi Iwai 3176065495 ALSA: usb-audio: Fix the missing ctl name suffix at parsing SU
commit 5a15f289ee upstream.

The commit 89b89d121f ("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: 89b89d121f ("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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-29 17:42:59 +01:00
..
6fire treewide: Fix typos in printk 2015-12-08 14:59:19 +01:00
bcd2000 ALSA: bcd2000: Make local data static 2015-05-26 13:00:01 +02:00
caiaq ALSA: caiaq: Fix stray URB at probe error path 2017-10-18 09:35:40 +02:00
hiface ALSA: hiface: Fix M2Tech hiFace driver sampling rate change 2017-01-06 10:40:12 +01:00
line6 ALSA: line6: Fix leftover URB at error-path during probe 2017-10-18 09:35:40 +02:00
misc ALSA: ua101: replace le16_to_cpu() with usb_endpoint_maxp() 2015-11-16 09:03:06 +01:00
usx2y ALSA: usx2y: Suppress kernel warning at page allocation failures 2017-10-12 11:51:20 +02:00
card.c ALSA: usb-audio: Check out-of-bounds access by corrupted buffer descriptor 2017-10-12 11:51:16 +02:00
card.h ALSA: usb: use TEAC UD-H01 quirk for more devices 2016-08-22 11:39:56 +02:00
clock.c ALSA: usb-audio: Add sanity checks in v2 clock parsers 2017-11-30 08:39:05 +00:00
clock.h ALSA: usb-audio: UAC2: do clock validity check earlier 2013-04-04 08:30:59 +02:00
debug.h ALSA: usb-audio: make hwc_debug a noop in case HW_CONST_DEBUG is not set 2011-05-18 11:44:35 +02:00
endpoint.c ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion 2017-08-06 18:59:49 -07:00
endpoint.h ALSA: usb-audio: Fix irq/process data synchronization 2017-01-12 11:39:05 +01:00
format.c ALSA: usb-audio: rmove print for failure of kmalloc 2016-08-22 11:41:02 +02:00
format.h ALSA: usb-audio: store protocol version in struct audioformat 2013-06-27 21:59:47 +02:00
helper.c ALSA: usb-audio: correct speed checking 2016-05-08 11:42:04 +02:00
helper.h ALSA: usb-audio: increase control transfer timeout 2011-09-27 09:21:48 +02:00
Kconfig [media] Revert "[media] sound/usb: Use Media Controller API to share media resources" 2016-03-31 15:02:33 -03:00
Makefile [media] Revert "[media] sound/usb: Use Media Controller API to share media resources" 2016-03-31 15:02:33 -03:00
midi.c ALSA: usb-midi: correct speed checking 2016-05-08 11:42:30 +02:00
midi.h ALSA: usb-audio: Refer to chip->usb_id for quirks and MIDI creation 2016-01-29 07:36:10 +01:00
mixer_maps.c ALSA: usb-audio: Change structure initialisation to C99 style 2016-06-17 16:58:41 +02:00
mixer_quirks.c ALSA: usb-audio: Add mute TLV for playback volumes on C-Media devices 2017-08-24 17:12:19 -07:00
mixer_quirks.h ALSA: usb-audio: Add a more accurate volume quirk for AudioQuest DragonFly 2015-12-14 10:13:17 +01:00
mixer_scarlett.c ALSA: usb-audio: Fix Scarlett 6i6 initialization typo 2014-12-18 08:39:17 +01:00
mixer_scarlett.h ALSA: usb-audio: Scarlett mixer interface for 6i6, 18i6, 18i8 and 18i20 2014-11-13 07:32:39 +01:00
mixer.c ALSA: usb-audio: Fix the missing ctl name suffix at parsing SU 2017-12-29 17:42:59 +01:00
mixer.h ALSA: usb-audio: Kill stray URB at exiting 2017-10-18 09:35:39 +02:00
pcm.c ALSA: usb-audio: add implicit fb quirk for Axe-Fx II 2017-04-12 12:41:17 +02:00
pcm.h ALSA: usb: refine delay information with USB frame counter 2011-09-12 10:30:20 +02:00
power.h ALSA: usbaudio: implement USB autosuspend 2011-03-11 14:59:29 +01:00
proc.c ALSA: usb-audio: Avoid nested autoresume calls 2015-08-26 15:38:25 +02:00
proc.h ALSA: usb-audio: refactor code 2010-03-05 08:17:14 +01:00
quirks-table.h ALSA: usb-audio: Add quirk for Syntek STK1160 2016-10-27 12:07:19 +02:00
quirks.c ALSA: usb-audio: Add native DSD support for Esoteric D-05X 2017-12-29 17:42:59 +01:00
quirks.h ALSA: usb-audio: Refer to chip->usb_id for quirks and MIDI creation 2016-01-29 07:36:10 +01:00
stream.c media fixes for v4.6-rc2 2016-04-05 06:47:50 -07:00
stream.h ALSA: snd-usb: re-order code 2011-09-14 17:07:02 +02:00
usbaudio.h Merge branch 'for-linus' into for-next 2016-05-10 16:06:04 +02:00