diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/slab.c b/mm/slab.c index 68ab88e2920e..09df506ae830 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -679,8 +679,10 @@ static struct alien_cache *__alloc_alien_cache(int node, int entries, struct alien_cache *alc = NULL; alc = kmalloc_node(memsize, gfp, node); - init_arraycache(&alc->ac, entries, batch); - spin_lock_init(&alc->lock); + if (alc) { + init_arraycache(&alc->ac, entries, batch); + spin_lock_init(&alc->lock); + } return alc; } |