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.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/persistent-data/dm-space-map.h b/drivers/md/persistent-data/dm-space-map.h
index a015cd11f6e9..6bf69922b5ad 100644
--- a/drivers/md/persistent-data/dm-space-map.h
+++ b/drivers/md/persistent-data/dm-space-map.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2011 Red Hat, Inc.
*
@@ -76,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)