dm: drop NULL test before kmem_cache_destroy() and mempool_destroy()
Remove DM's unneeded NULL tests before calling these destroy functions, now that they check for NULL, thanks to these v4.3 commits:3942d2991
("mm/slab_common: allow NULL cache pointer in kmem_cache_destroy()")4e3ca3e03
("mm/mempool: allow NULL `pool' pointer in mempool_destroy()") The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x; @@ -if (x != NULL) \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
这个提交包含在:
@@ -249,9 +249,7 @@ void dm_region_hash_destroy(struct dm_region_hash *rh)
|
||||
if (rh->log)
|
||||
dm_dirty_log_destroy(rh->log);
|
||||
|
||||
if (rh->region_pool)
|
||||
mempool_destroy(rh->region_pool);
|
||||
|
||||
mempool_destroy(rh->region_pool);
|
||||
vfree(rh->buckets);
|
||||
kfree(rh);
|
||||
}
|
||||
|
在新工单中引用
屏蔽一个用户