mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
ALSA: usb-audio: Fix packet size calculation regression
The commitd215f63d49
("ALSA: usb-audio: Check available frames for the next packet size") introduced the available frame size check, but the conversion forgot to initialize the temporary variable properly, and it resulted in a bogus calculation. This patch fixes it. Fixes:d215f63d49
("ALSA: usb-audio: Check available frames for the next packet size") Reported-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20211001104417.14291-1-colin.king@canonical.com Link: https://lore.kernel.org/r/20211001105425.16191-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
28c369e608
commit
23939115be
1 changed files with 1 additions and 1 deletions
|
@ -182,7 +182,7 @@ static int next_packet_size(struct snd_usb_endpoint *ep, unsigned int avail)
|
||||||
if (ep->fill_max)
|
if (ep->fill_max)
|
||||||
return ep->maxframesize;
|
return ep->maxframesize;
|
||||||
|
|
||||||
sample_accum += ep->sample_rem;
|
sample_accum = ep->sample_accum + ep->sample_rem;
|
||||||
if (sample_accum >= ep->pps) {
|
if (sample_accum >= ep->pps) {
|
||||||
sample_accum -= ep->pps;
|
sample_accum -= ep->pps;
|
||||||
ret = ep->packsize[1];
|
ret = ep->packsize[1];
|
||||||
|
|
Loading…
Add table
Reference in a new issue