Re: [PATCH v2 1/5] ALSA: line6: Fix handling of zero-length capture packets
From: Takashi Iwai
Date: Sat Oct 10 2026 - 04:05:20 EST
On Fri, 09 Oct 2026 15:33:35 +0200,
Takashi Iwai wrote:
>
> The LINE6 playback engine assumes that line6pcm->prev_fsize=0
> indicates that there was no input packet to be processed, and
> synthesizes the frames. But, when a capture stream receives a
> zero-length (or a very small size) packet, it sets 0 to prev_fsize,
> while playback engine still believes it's for synthesis, hence it
> tries to copy the larger data than the actual input data.
>
> As prev_fsize=0 can't be a good indication for "no input", change the
> meaning slightly: now prev_fsize=-1 means no input, while prev_fsize=0
> means it's a zero-length packet.
>
> As a result, the outgoing packet length can be also zero, so the
> corresponding check is dropped, too; otherwise the outgoing URB will
> be lost.
>
> Fixes: 1027f476f507 ("staging: line6: sync with upstream")
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
> ---
> v1->v2: drop the zero urb length check code, too
Hm, still this one looks tricky and can't cover the full cases, as it
seems. So I dropped this from the series for reconsideration for now.
Takashi