slab: alien caches must not be initialized if the allocation of the alien cache failed
authorChristoph Lameter <[email protected]>
Tue, 8 Jan 2019 23:23:00 +0000 (15:23 -0800)
committerLinus Torvalds <[email protected]>
Wed, 9 Jan 2019 01:15:11 +0000 (17:15 -0800)
commit09c2e76ed734a1d36470d257a778aaba28e86531
tree2f951b3f6daa70b8c3f2c6371b5c2c62d6bd6455
parentba4a45746c362b665e245c50b870615f02f34781
slab: alien caches must not be initialized if the allocation of the alien cache failed

Callers of __alloc_alien() check for NULL.  We must do the same check in
__alloc_alien_cache to avoid NULL pointer dereferences on allocation
failures.

Link: http://lkml.kernel.org/r/010001680f42f192-82b4e12e-1565-4ee0-ae1f-1e98974906aa-000000@email.amazonses.com
Fixes: 49dfc304ba241 ("slab: use the lock on alien_cache, instead of the lock on array_cache")
Fixes: c8522a3a5832b ("Slab: introduce alloc_alien")
Signed-off-by: Christoph Lameter <[email protected]>
Reported-by: [email protected]
Reviewed-by: Andrew Morton <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/slab.c