diff options
Diffstat (limited to 'sound/core/seq/seq_fifo.c')
-rw-r--r-- | sound/core/seq/seq_fifo.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/core/seq/seq_fifo.c b/sound/core/seq/seq_fifo.c index 1d5acbe0c08b..3490d21ab9e7 100644 --- a/sound/core/seq/seq_fifo.c +++ b/sound/core/seq/seq_fifo.c | |||
@@ -70,6 +70,9 @@ void snd_seq_fifo_delete(struct snd_seq_fifo **fifo) | |||
70 | return; | 70 | return; |
71 | *fifo = NULL; | 71 | *fifo = NULL; |
72 | 72 | ||
73 | if (f->pool) | ||
74 | snd_seq_pool_mark_closing(f->pool); | ||
75 | |||
73 | snd_seq_fifo_clear(f); | 76 | snd_seq_fifo_clear(f); |
74 | 77 | ||
75 | /* wake up clients if any */ | 78 | /* wake up clients if any */ |
@@ -135,6 +138,7 @@ int snd_seq_fifo_event_in(struct snd_seq_fifo *f, | |||
135 | f->tail = cell; | 138 | f->tail = cell; |
136 | if (f->head == NULL) | 139 | if (f->head == NULL) |
137 | f->head = cell; | 140 | f->head = cell; |
141 | cell->next = NULL; | ||
138 | f->cells++; | 142 | f->cells++; |
139 | spin_unlock_irqrestore(&f->lock, flags); | 143 | spin_unlock_irqrestore(&f->lock, flags); |
140 | 144 | ||
@@ -214,6 +218,8 @@ void snd_seq_fifo_cell_putback(struct snd_seq_fifo *f, | |||
214 | spin_lock_irqsave(&f->lock, flags); | 218 | spin_lock_irqsave(&f->lock, flags); |
215 | cell->next = f->head; | 219 | cell->next = f->head; |
216 | f->head = cell; | 220 | f->head = cell; |
221 | if (!f->tail) | ||
222 | f->tail = cell; | ||
217 | f->cells++; | 223 | f->cells++; |
218 | spin_unlock_irqrestore(&f->lock, flags); | 224 | spin_unlock_irqrestore(&f->lock, flags); |
219 | } | 225 | } |
@@ -259,6 +265,10 @@ int snd_seq_fifo_resize(struct snd_seq_fifo *f, int poolsize) | |||
259 | /* NOTE: overflow flag is not cleared */ | 265 | /* NOTE: overflow flag is not cleared */ |
260 | spin_unlock_irqrestore(&f->lock, flags); | 266 | spin_unlock_irqrestore(&f->lock, flags); |
261 | 267 | ||
268 | /* close the old pool and wait until all users are gone */ | ||
269 | snd_seq_pool_mark_closing(oldpool); | ||
270 | snd_use_lock_sync(&f->use_lock); | ||
271 | |||
262 | /* release cells in old pool */ | 272 | /* release cells in old pool */ |
263 | for (cell = oldhead; cell; cell = next) { | 273 | for (cell = oldhead; cell; cell = next) { |
264 | next = cell->next; | 274 | next = cell->next; |