Merge tag 'for-linus-20180204' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / drivers / md / dm-thin.c
index f91d771..629c555 100644 (file)
@@ -492,6 +492,11 @@ static void pool_table_init(void)
        INIT_LIST_HEAD(&dm_thin_pool_table.pools);
 }
 
+static void pool_table_exit(void)
+{
+       mutex_destroy(&dm_thin_pool_table.mutex);
+}
+
 static void __pool_table_insert(struct pool *pool)
 {
        BUG_ON(!mutex_is_locked(&dm_thin_pool_table.mutex));
@@ -1717,7 +1722,7 @@ static void __remap_and_issue_shared_cell(void *context,
                    bio_op(bio) == REQ_OP_DISCARD)
                        bio_list_add(&info->defer_bios, bio);
                else {
-                       struct dm_thin_endio_hook *h = dm_per_bio_data(bio, sizeof(struct dm_thin_endio_hook));;
+                       struct dm_thin_endio_hook *h = dm_per_bio_data(bio, sizeof(struct dm_thin_endio_hook));
 
                        h->shared_read_entry = dm_deferred_entry_inc(info->tc->pool->shared_read_ds);
                        inc_all_io_entry(info->tc->pool, bio);
@@ -4387,6 +4392,8 @@ static void dm_thin_exit(void)
        dm_unregister_target(&pool_target);
 
        kmem_cache_destroy(_new_mapping_cache);
+
+       pool_table_exit();
 }
 
 module_init(dm_thin_init);