diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-01 16:38:16 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-01 16:38:16 -0800 |
| commit | 523462df282fc527a01bceca5125017e2259fbf5 (patch) | |
| tree | b3cca26b719ce1f46f203e2f86334525a2f50e14 /sound/core/seq/seq_memory.c | |
| parent | 35bf7692e765c2275bf93fe573f7ca868ab73453 (diff) | |
| parent | fc77dbd34c5c99bce46d40a2491937c3bcbd10af (diff) | |
| download | linux-next-523462df282fc527a01bceca5125017e2259fbf5.tar.gz linux-next-523462df282fc527a01bceca5125017e2259fbf5.zip | |
Merge 4.5-rc6 into char-misc-next
We want the fixes in here, and others are sending us pull requests based
on this kernel tree.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/core/seq/seq_memory.c')
| -rw-r--r-- | sound/core/seq/seq_memory.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c index 801076687bb1..c850345c43b5 100644 --- a/sound/core/seq/seq_memory.c +++ b/sound/core/seq/seq_memory.c @@ -383,15 +383,20 @@ int snd_seq_pool_init(struct snd_seq_pool *pool) if (snd_BUG_ON(!pool)) return -EINVAL; - if (pool->ptr) /* should be atomic? */ - return 0; - pool->ptr = vmalloc(sizeof(struct snd_seq_event_cell) * pool->size); - if (!pool->ptr) + cellptr = vmalloc(sizeof(struct snd_seq_event_cell) * pool->size); + if (!cellptr) return -ENOMEM; /* add new cells to the free cell list */ spin_lock_irqsave(&pool->lock, flags); + if (pool->ptr) { + spin_unlock_irqrestore(&pool->lock, flags); + vfree(cellptr); + return 0; + } + + pool->ptr = cellptr; pool->free = NULL; for (cell = 0; cell < pool->size; cell++) { |
