Skip to content

Commit

Permalink
zsmalloc: remove null check from destroy_handle_cache()
Browse files Browse the repository at this point in the history
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: Sergey Senozhatsky <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
sergey-senozhatsky authored and torvalds committed Sep 8, 2015
1 parent b3e237f commit cd10add
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/zsmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ static int create_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)
Expand Down

0 comments on commit cd10add

Please sign in to comment.