diff options
author | Adam Goode <agoode@google.com> | 2014-06-04 01:02:51 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-06-04 01:12:12 -0400 |
commit | 21fd3e956ee8a307a06bc6e095f5767a00eb2a7e (patch) | |
tree | 9656b152c0556e280c58a1685eb5c3ad0fce23c0 /sound | |
parent | 16088cb6c02d0b766b9b8d7edff98da7f1c93205 (diff) |
ALSA: seq: correctly detect input buffer overflow
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/seq/seq_fifo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/seq/seq_fifo.c b/sound/core/seq/seq_fifo.c index 559989992bef..53a403e17c5b 100644 --- a/sound/core/seq/seq_fifo.c +++ b/sound/core/seq/seq_fifo.c | |||
@@ -124,7 +124,7 @@ int snd_seq_fifo_event_in(struct snd_seq_fifo *f, | |||
124 | snd_use_lock_use(&f->use_lock); | 124 | snd_use_lock_use(&f->use_lock); |
125 | err = snd_seq_event_dup(f->pool, event, &cell, 1, NULL); /* always non-blocking */ | 125 | err = snd_seq_event_dup(f->pool, event, &cell, 1, NULL); /* always non-blocking */ |
126 | if (err < 0) { | 126 | if (err < 0) { |
127 | if (err == -ENOMEM) | 127 | if ((err == -ENOMEM) || (err == -EAGAIN)) |
128 | atomic_inc(&f->overflow); | 128 | atomic_inc(&f->overflow); |
129 | snd_use_lock_free(&f->use_lock); | 129 | snd_use_lock_free(&f->use_lock); |
130 | return err; | 130 | return err; |