aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 3d121cbc2fde..b99df48cffed 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1007,18 +1007,18 @@ void dm_get(struct mapped_device *md)
1007 1007
1008void dm_put(struct mapped_device *md) 1008void dm_put(struct mapped_device *md)
1009{ 1009{
1010 struct dm_table *map = dm_get_table(md); 1010 struct dm_table *map;
1011 1011
1012 if (atomic_dec_and_test(&md->holders)) { 1012 if (atomic_dec_and_test(&md->holders)) {
1013 map = dm_get_table(md);
1013 if (!dm_suspended(md)) { 1014 if (!dm_suspended(md)) {
1014 dm_table_presuspend_targets(map); 1015 dm_table_presuspend_targets(map);
1015 dm_table_postsuspend_targets(map); 1016 dm_table_postsuspend_targets(map);
1016 } 1017 }
1017 __unbind(md); 1018 __unbind(md);
1019 dm_table_put(map);
1018 free_dev(md); 1020 free_dev(md);
1019 } 1021 }
1020
1021 dm_table_put(map);
1022} 1022}
1023 1023
1024/* 1024/*