提交 cd10add0 编写于 作者: S Sergey Senozhatsky 提交者: Linus Torvalds

zsmalloc: remove null check from destroy_handle_cache()

We can pass a NULL cache pointer to kmem_cache_destroy(), because it
NULL-checks its argument now.  Remove redundant test from
destroy_handle_cache().
Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: NMinchan Kim <minchan@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b3e237f1
...@@ -288,8 +288,7 @@ static int create_handle_cache(struct zs_pool *pool) ...@@ -288,8 +288,7 @@ static int create_handle_cache(struct zs_pool *pool)
static void destroy_handle_cache(struct zs_pool *pool) static void destroy_handle_cache(struct zs_pool *pool)
{ {
if (pool->handle_cachep) kmem_cache_destroy(pool->handle_cachep);
kmem_cache_destroy(pool->handle_cachep);
} }
static unsigned long alloc_handle(struct zs_pool *pool) static unsigned long alloc_handle(struct zs_pool *pool)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册