Skip to content
Snippets Groups Projects
Commit be22db77 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: usb-audio: Fix uninitialized variable at __uac_clock_find_source()


The cur variable indicating the currently selected clock source can be
theoretically used as uninitialized after the recent commit
481f17c4 ("ALSA: usb-audio: Handle error for the current selector
gracefully").  For addressing it, initialize it before use.

Also, one place seems setting 0 to a wrong variable ret, instead of
cur; otherwise it makes little sense.  Since the initialization is
done beforehand, we can get rid of this line, too.

Fixes: 481f17c4 ("ALSA: usb-audio: Handle error for the current selector gracefully")
Reported-by: default avatarColin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/4b261d68-f53f-240d-2d8a-2f88b337849d@canonical.com
Link: https://lore.kernel.org/r/s5hfsyhh97t.wl-tiwai@suse.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent bdaedca7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment