Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a12fc00b authored by zhong jiang's avatar zhong jiang Committed by Jens Axboe
Browse files

drivers/block/drbd: remove the null check for kmem_cache_destroy



kmem_cache_destroy has taken null pointer into account. So it is
safe to drop the null check before calling the function.

Signed-off-by: default avatarzhong jiang <zhongjiang@huawei.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 69daf897
Loading
Loading
Loading
Loading
+4 −8
Original line number Original line Diff line number Diff line
@@ -2103,13 +2103,9 @@ static void drbd_destroy_mempools(void)
	mempool_exit(&drbd_md_io_page_pool);
	mempool_exit(&drbd_md_io_page_pool);
	mempool_exit(&drbd_ee_mempool);
	mempool_exit(&drbd_ee_mempool);
	mempool_exit(&drbd_request_mempool);
	mempool_exit(&drbd_request_mempool);
	if (drbd_ee_cache)
	kmem_cache_destroy(drbd_ee_cache);
	kmem_cache_destroy(drbd_ee_cache);
	if (drbd_request_cache)
	kmem_cache_destroy(drbd_request_cache);
	kmem_cache_destroy(drbd_request_cache);
	if (drbd_bm_ext_cache)
	kmem_cache_destroy(drbd_bm_ext_cache);
	kmem_cache_destroy(drbd_bm_ext_cache);
	if (drbd_al_ext_cache)
	kmem_cache_destroy(drbd_al_ext_cache);
	kmem_cache_destroy(drbd_al_ext_cache);


	drbd_ee_cache        = NULL;
	drbd_ee_cache        = NULL;