mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 02:21:16 +00:00
ALSA: usb-audio: Add check return value for usb_string()
commit 89b89d121ffcf8d9546633b98ded9d18b8f75891 upstream. snd_usb_copy_string_desc() returns zero if usb_string() fails. In case of failure, we need to check the snd_usb_copy_string_desc()'s return value and add an exception case Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
parent
411ff1659a
commit
de421c03f6
1 changed files with 6 additions and 4 deletions
|
@ -2016,11 +2016,13 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, void
|
|||
if (len)
|
||||
;
|
||||
else if (nameid)
|
||||
snd_usb_copy_string_desc(state, nameid, kctl->id.name, sizeof(kctl->id.name));
|
||||
else {
|
||||
len = snd_usb_copy_string_desc(state, nameid, kctl->id.name,
|
||||
sizeof(kctl->id.name));
|
||||
else
|
||||
len = get_term_name(state, &state->oterm,
|
||||
kctl->id.name, sizeof(kctl->id.name), 0);
|
||||
if (! len)
|
||||
|
||||
if (!len) {
|
||||
strlcpy(kctl->id.name, "USB", sizeof(kctl->id.name));
|
||||
|
||||
if (desc->bDescriptorSubtype == UAC2_CLOCK_SELECTOR)
|
||||
|
|
Loading…
Reference in a new issue