summaryrefslogtreecommitdiff
path: root/drivers/md/persistent-data/dm-space-map.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/persistent-data/dm-space-map.h')
-rw-r--r--drivers/md/persistent-data/dm-space-map.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/persistent-data/dm-space-map.h b/drivers/md/persistent-data/dm-space-map.h
index dab490353781..6bf69922b5ad 100644
--- a/drivers/md/persistent-data/dm-space-map.h
+++ b/drivers/md/persistent-data/dm-space-map.h
@@ -77,7 +77,8 @@ struct dm_space_map {
static inline void dm_sm_destroy(struct dm_space_map *sm)
{
- sm->destroy(sm);
+ if (sm)
+ sm->destroy(sm);
}
static inline int dm_sm_extend(struct dm_space_map *sm, dm_block_t extra_blocks)