Skip to content

Commit

Permalink
bcache: do not check NULL pointer before calling kmem_cache_destroy
Browse files Browse the repository at this point in the history
kmem_cache_destroy() is safe for NULL pointer as input, the NULL pointer
checking is unncessary. This patch just removes the NULL pointer checking
to make code simpler.

Signed-off-by: Coly Li <colyli@suse.de>
Reviewed-by: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Coly Li authored and Jens Axboe committed Aug 11, 2018
1 parent bc81b47 commit 3069211
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/md/bcache/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1367,8 +1367,7 @@ void bch_flash_dev_request_init(struct bcache_device *d)

void bch_request_exit(void)
{
if (bch_search_cache)
kmem_cache_destroy(bch_search_cache);
kmem_cache_destroy(bch_search_cache);
}

int __init bch_request_init(void)
Expand Down

0 comments on commit 3069211

Please sign in to comment.