mirror of
https://github.com/joel16/android_kernel_sony_msm8994.git
synced 2024-11-27 06:01:12 +00:00
UPSTREAM: zsmalloc: fix a null pointer dereference in destroy_handle_cache()
(cherry-pick from commit 02f7b4145da113683ad64c74bf64605e16b71789) If zs_create_pool()->create_handle_cache()->kmem_cache_create() or pool->name allocation fails, zs_create_pool()->destroy_handle_cache() will dereference the NULL pool->handle_cachep. Modify destroy_handle_cache() to avoid this. Bug: 25951511 Change-Id: Ie4ea82fe34ac02e6e2548e6ed47257366d7b92f5 Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
7cedb91c03
commit
e9a0a57ae3
@ -290,7 +290,8 @@ static int create_handle_cache(struct zs_pool *pool)
|
||||
|
||||
static void destroy_handle_cache(struct zs_pool *pool)
|
||||
{
|
||||
kmem_cache_destroy(pool->handle_cachep);
|
||||
if (pool->handle_cachep)
|
||||
kmem_cache_destroy(pool->handle_cachep);
|
||||
}
|
||||
|
||||
static unsigned long alloc_handle(struct zs_pool *pool)
|
||||
|
Loading…
Reference in New Issue
Block a user