summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r--drivers/md/dm-ioctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index c740153b4e52..1e03bc89e20f 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -2069,7 +2069,7 @@ int __init dm_early_create(struct dm_ioctl *dmi,
2069 /* alloc table */ 2069 /* alloc table */
2070 r = dm_table_create(&t, get_mode(dmi), dmi->target_count, md); 2070 r = dm_table_create(&t, get_mode(dmi), dmi->target_count, md);
2071 if (r) 2071 if (r)
2072 goto err_destroy_dm; 2072 goto err_hash_remove;
2073 2073
2074 /* add targets */ 2074 /* add targets */
2075 for (i = 0; i < dmi->target_count; i++) { 2075 for (i = 0; i < dmi->target_count; i++) {
@@ -2116,6 +2116,10 @@ int __init dm_early_create(struct dm_ioctl *dmi,
2116 2116
2117err_destroy_table: 2117err_destroy_table:
2118 dm_table_destroy(t); 2118 dm_table_destroy(t);
2119err_hash_remove:
2120 (void) __hash_remove(__get_name_cell(dmi->name));
2121 /* release reference from __get_name_cell */
2122 dm_put(md);
2119err_destroy_dm: 2123err_destroy_dm:
2120 dm_put(md); 2124 dm_put(md);
2121 dm_destroy(md); 2125 dm_destroy(md);