summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-12-18 23:36:57 +0100
committerTakashi Iwai <tiwai@suse.de>2017-12-19 07:41:07 +0100
commit5a15f289ee87eaf33f13f08a4909ec99d837ec5f (patch)
tree27b5262477f3b9baf216e90fe12dca3d52a3d2be /drivers
parent9226665159f0367ad08bc7d5dd194aeadb90316f (diff)
downloadlinux-5a15f289ee87eaf33f13f08a4909ec99d837ec5f.tar.bz2
ALSA: usb-audio: Fix the missing ctl name suffix at parsing SU
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> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions