]> git.baikalelectronics.ru Git - kernel.git/commit
zsmalloc: fix a null pointer dereference in destroy_handle_cache()
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Wed, 10 Jun 2015 18:14:57 +0000 (11:14 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Jun 2015 23:43:43 +0000 (16:43 -0700)
commit830ba2f510d375cbf41d2c013c20d323529fcb98
treef3b5f68fdd7bf92d29e615284b28739d55abc089
parentd425618e06261bfcc373edc0911e688a335206c5
zsmalloc: fix a null pointer dereference in destroy_handle_cache()

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.

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>
mm/zsmalloc.c