Re: [PATCH] ALSA: pcmtest: Return -EFAULT on pattern read copy failure
From: Takashi Iwai
Date: Mon May 04 2026 - 07:27:23 EST
On Fri, 01 May 2026 19:45:14 +0200,
Cássio Gabriel wrote:
>
> pattern_write() reports -EFAULT when copy_from_user() fails, but
> pattern_read() converts copy_to_user() failures into a zero-length read.
> That makes a userspace buffer fault look like EOF instead of reporting the
> actual error.
>
> Return -EFAULT from pattern_read() when copying the pattern data to
> userspace fails, and update the file offset only after a successful copy.
>
> Fixes: 315a3d57c64c ("ALSA: Implement the new Virtual PCM Test Driver")
> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@xxxxxxxxx>
Applied now. Thanks.
Takashi