Re: [PATCH] ALSA: scarlett2: Allow flash writes ending at segment boundary
From: Takashi Iwai
Date: Wed May 20 2026 - 01:53:53 EST
On Tue, 19 May 2026 16:46:19 +0200,
Cássio Gabriel wrote:
>
> scarlett2_hwdep_write() rejects writes when offset + count is greater than
> or equal to the selected flash segment size. That incorrectly treats a
> write ending exactly at the end of the segment as out of space, although
> the last byte written is still within the segment.
>
> Split invalid argument checks from the segment-space check, keep
> zero-length writes as no-ops, and compare count against the remaining
> segment size. This permits exact-end writes and avoids relying on
> offset + count before deciding whether the request is in bounds.
>
> Fixes: 1abfbd3c9527 ("ALSA: scarlett2: Add support for uploading new firmware")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@xxxxxxxxx>
Applied now. Thanks.
Takashi