Re: [PATCH v3 7/7] ALSA: seq: Don't lose partial read failure

From: Takashi Iwai

Date: Thu Oct 08 2026 - 04:57:13 EST


On Thu, 08 Oct 2026 10:32:29 +0200,
Cezary Rojewski wrote:
>
> On 10/7/2026 7:25 PM, Takashi Iwai wrote:
>
> > --- a/sound/core/seq/seq_clientmgr.c
> > +++ b/sound/core/seq/seq_clientmgr.c
> > @@ -480,11 +480,11 @@ static ssize_t snd_seq_read(struct file *file, char __user *buf, size_t count,
> > if (err < 0) {
> > if (cell)
> > snd_seq_fifo_cell_putback(fifo, cell);
> > - if (err == -EAGAIN && result > 0)
> > - err = 0;
> > }
> >
> > - return (err < 0) ? err : result;
> > + if (result > 0)
> > + return result;
> > + return err < 0 ? err : 0;
>
> Can 'err' even be positive? Looks to me as if 'result' holds the bytes
> and flat 'return err' suffices.

Yes, it's just to make sure.


Takashi