Skip to content

Commit

Permalink
ALSA: usb-audio: Always initialize fixed_rate in snd_usb_find_implici…
Browse files Browse the repository at this point in the history
…t_fb_sync_format()

Handle the fallback code path, too.

Fixes: fd28941 ("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 <[email protected]>
Cc: <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
perexg authored and tiwai committed Jan 9, 2023
1 parent ae50e2a commit 291e9da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/usb/implicit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
target->fmt_type);
if (!subs)
return sync_fmt;
goto end;

high_score = 0;
list_for_each_entry(fp, &subs->fmt_list, list) {
Expand All @@ -485,6 +485,7 @@ snd_usb_find_implicit_fb_sync_format(struct snd_usb_audio *chip,
}
}

end:
if (fixed_rate)
*fixed_rate = snd_usb_pcm_has_fixed_rate(subs);
return sync_fmt;
Expand Down
2 changes: 2 additions & 0 deletions sound/usb/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ bool snd_usb_pcm_has_fixed_rate(struct snd_usb_substream *subs)
struct snd_usb_audio *chip = subs->stream->chip;
int rate = -1;

if (!subs)
return false;
if (!(chip->quirk_flags & QUIRK_FLAG_FIXED_RATE))
return false;
list_for_each_entry(fp, &subs->fmt_list, list) {
Expand Down

0 comments on commit 291e9da

Please sign in to comment.