Loading mm/slab_common.c +10 −5 Original line number Original line Diff line number Diff line Loading @@ -53,17 +53,19 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align { { struct kmem_cache *s = NULL; struct kmem_cache *s = NULL; get_online_cpus(); mutex_lock(&slab_mutex); #ifdef CONFIG_DEBUG_VM #ifdef CONFIG_DEBUG_VM if (!name || in_interrupt() || size < sizeof(void *) || if (!name || in_interrupt() || size < sizeof(void *) || size > KMALLOC_MAX_SIZE) { size > KMALLOC_MAX_SIZE) { printk(KERN_ERR "kmem_cache_create(%s) integrity check" printk(KERN_ERR "kmem_cache_create(%s) integrity check" " failed\n", name); " failed\n", name); goto oops; goto out; } } #endif get_online_cpus(); mutex_lock(&slab_mutex); #ifdef CONFIG_DEBUG_VM list_for_each_entry(s, &slab_caches, list) { list_for_each_entry(s, &slab_caches, list) { char tmp; char tmp; int res; int res; Loading Loading @@ -102,6 +104,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align mutex_unlock(&slab_mutex); mutex_unlock(&slab_mutex); put_online_cpus(); put_online_cpus(); #ifdef CONFIG_DEBUG_VM out: #endif if (!s && (flags & SLAB_PANIC)) if (!s && (flags & SLAB_PANIC)) panic("kmem_cache_create: Failed to create slab '%s'\n", name); panic("kmem_cache_create: Failed to create slab '%s'\n", name); Loading Loading
mm/slab_common.c +10 −5 Original line number Original line Diff line number Diff line Loading @@ -53,17 +53,19 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align { { struct kmem_cache *s = NULL; struct kmem_cache *s = NULL; get_online_cpus(); mutex_lock(&slab_mutex); #ifdef CONFIG_DEBUG_VM #ifdef CONFIG_DEBUG_VM if (!name || in_interrupt() || size < sizeof(void *) || if (!name || in_interrupt() || size < sizeof(void *) || size > KMALLOC_MAX_SIZE) { size > KMALLOC_MAX_SIZE) { printk(KERN_ERR "kmem_cache_create(%s) integrity check" printk(KERN_ERR "kmem_cache_create(%s) integrity check" " failed\n", name); " failed\n", name); goto oops; goto out; } } #endif get_online_cpus(); mutex_lock(&slab_mutex); #ifdef CONFIG_DEBUG_VM list_for_each_entry(s, &slab_caches, list) { list_for_each_entry(s, &slab_caches, list) { char tmp; char tmp; int res; int res; Loading Loading @@ -102,6 +104,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align mutex_unlock(&slab_mutex); mutex_unlock(&slab_mutex); put_online_cpus(); put_online_cpus(); #ifdef CONFIG_DEBUG_VM out: #endif if (!s && (flags & SLAB_PANIC)) if (!s && (flags & SLAB_PANIC)) panic("kmem_cache_create: Failed to create slab '%s'\n", name); panic("kmem_cache_create: Failed to create slab '%s'\n", name); Loading