Skip to content

Commit 8555d69

Browse files
CassivsGabriellisgregkh
authored andcommitted
ALSA: seq_oss: return full count for successful SEQ_FULLSIZE writes
commit bbc6c0d upstream. snd_seq_oss_write() currently returns the raw load_patch() callback result for SEQ_FULLSIZE events. That callback is documented as returning 0 on success and -errno on failure, but snd_seq_oss_write() is the file write path and should report the number of user bytes consumed on success. Some in-tree backends also return backend-specific positive values, which can still be shorter than the original write size. Return the full byte count for successful SEQ_FULLSIZE writes. Preserve negative errors and convert any nonnegative completion to the original count. Cc: stable@vger.kernel.org Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com> Link: https://patch.msgid.link/20260324-alsa-seq-oss-fullsize-write-return-v1-1-66d448510538@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 25ded53 commit 8555d69

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sound/core/seq/oss/seq_oss_rw.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ snd_seq_oss_write(struct seq_oss_devinfo *dp, const char __user *buf, int count,
101101
break;
102102
}
103103
fmt = (*(unsigned short *)rec.c) & 0xffff;
104-
/* FIXME the return value isn't correct */
105-
return snd_seq_oss_synth_load_patch(dp, rec.s.dev,
106-
fmt, buf, 0, count);
104+
err = snd_seq_oss_synth_load_patch(dp, rec.s.dev,
105+
fmt, buf, 0, count);
106+
return err < 0 ? err : count;
107107
}
108108
if (ev_is_long(&rec)) {
109109
/* extended code */

0 commit comments

Comments
 (0)