mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
ALSA: usb-audio: Always initialize fixed_rate in snd_usb_find_implicit_fb_sync_format()
Handle the fallback code path, too.
Fixes: fd28941cff
("ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless")
BugLink: https://lore.kernel.org/alsa-devel/Y7frf3N%2FxzvESEsN@kili/
Reported-by: Dan Carpenter <error27@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20230109141133.335543-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
ae50e2ab12
commit
291e9da914
@ -471,7 +471,7 @@ snd_usb_find_implicit_fb_sync_format(struct snd_usb_audio *chip,
|
|||||||
subs = find_matching_substream(chip, stream, target->sync_ep,
|
subs = find_matching_substream(chip, stream, target->sync_ep,
|
||||||
target->fmt_type);
|
target->fmt_type);
|
||||||
if (!subs)
|
if (!subs)
|
||||||
return sync_fmt;
|
goto end;
|
||||||
|
|
||||||
high_score = 0;
|
high_score = 0;
|
||||||
list_for_each_entry(fp, &subs->fmt_list, list) {
|
list_for_each_entry(fp, &subs->fmt_list, list) {
|
||||||
@ -485,6 +485,7 @@ snd_usb_find_implicit_fb_sync_format(struct snd_usb_audio *chip,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
if (fixed_rate)
|
if (fixed_rate)
|
||||||
*fixed_rate = snd_usb_pcm_has_fixed_rate(subs);
|
*fixed_rate = snd_usb_pcm_has_fixed_rate(subs);
|
||||||
return sync_fmt;
|
return sync_fmt;
|
||||||
|
@ -163,6 +163,8 @@ bool snd_usb_pcm_has_fixed_rate(struct snd_usb_substream *subs)
|
|||||||
struct snd_usb_audio *chip = subs->stream->chip;
|
struct snd_usb_audio *chip = subs->stream->chip;
|
||||||
int rate = -1;
|
int rate = -1;
|
||||||
|
|
||||||
|
if (!subs)
|
||||||
|
return false;
|
||||||
if (!(chip->quirk_flags & QUIRK_FLAG_FIXED_RATE))
|
if (!(chip->quirk_flags & QUIRK_FLAG_FIXED_RATE))
|
||||||
return false;
|
return false;
|
||||||
list_for_each_entry(fp, &subs->fmt_list, list) {
|
list_for_each_entry(fp, &subs->fmt_list, list) {
|
||||||
|
Loading…
Reference in New Issue
Block a user