ALSA: seq: correctly detect input buffer overflow
authorAdam Goode <agoode@google.com>
Wed, 4 Jun 2014 05:02:51 +0000 (01:02 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 31 May 2018 23:30:02 +0000 (00:30 +0100)
commitd89ffc7140e70fd8429f7147c552bdf22750a717
treefd96a52cba13f473537d39e228ee450a08e3c4d4
parentc96a7302975ce043f565c9ce2359794e1397488c
ALSA: seq: correctly detect input buffer overflow

commit 21fd3e956ee8a307a06bc6e095f5767a00eb2a7e upstream.

snd_seq_event_dup returns -ENOMEM in some buffer-full conditions,
but usually returns -EAGAIN. Make -EAGAIN trigger the overflow
condition in snd_seq_fifo_event_in so that the fifo is cleared
and -ENOSPC is returned to userspace as stated in the alsa-lib docs.

Signed-off-by: Adam Goode <agoode@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
sound/core/seq/seq_fifo.c