diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-03-28 16:09:45 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-04-09 17:22:46 +0200 |
commit | fd7ae83de11a597cbe15770382f101c784a79b1c (patch) | |
tree | c495bdef82aba389bceaa99fa573171193743655 /sound/core/seq/seq_memory.c | |
parent | df55531b8b0eea9d2473f5697ae4f38d0df6bec7 (diff) | |
download | linux-fd7ae83de11a597cbe15770382f101c784a79b1c.tar.gz linux-fd7ae83de11a597cbe15770382f101c784a79b1c.tar.bz2 linux-fd7ae83de11a597cbe15770382f101c784a79b1c.zip |
ALSA: seq: Use kvmalloc() for cell pools
Use kvmalloc() for allocating cell pools since the pool size can be
relatively small that may be covered better by slab.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq/seq_memory.c')
-rw-r--r-- | sound/core/seq/seq_memory.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c index 5b0388202bac..6ea4d8a5a71e 100644 --- a/sound/core/seq/seq_memory.c +++ b/sound/core/seq/seq_memory.c @@ -24,7 +24,7 @@ #include <linux/export.h> #include <linux/slab.h> #include <linux/sched/signal.h> -#include <linux/vmalloc.h> +#include <linux/mm.h> #include <sound/core.h> #include <sound/seq_kernel.h> @@ -389,8 +389,8 @@ int snd_seq_pool_init(struct snd_seq_pool *pool) if (snd_BUG_ON(!pool)) return -EINVAL; - cellptr = vmalloc(array_size(sizeof(struct snd_seq_event_cell), - pool->size)); + cellptr = kvmalloc_array(sizeof(struct snd_seq_event_cell), pool->size, + GFP_KERNEL); if (!cellptr) return -ENOMEM; @@ -398,7 +398,7 @@ int snd_seq_pool_init(struct snd_seq_pool *pool) spin_lock_irqsave(&pool->lock, flags); if (pool->ptr) { spin_unlock_irqrestore(&pool->lock, flags); - vfree(cellptr); + kvfree(cellptr); return 0; } @@ -456,7 +456,7 @@ int snd_seq_pool_done(struct snd_seq_pool *pool) pool->total_elements = 0; spin_unlock_irqrestore(&pool->lock, flags); - vfree(ptr); + kvfree(ptr); spin_lock_irqsave(&pool->lock, flags); pool->closing = 0; |