summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-era-target.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-era-target.c')
-rw-r--r--drivers/md/dm-era-target.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-era-target.c b/drivers/md/dm-era-target.c
index 414dad4cb49b..ad913cd4aded 100644
--- a/drivers/md/dm-era-target.c
+++ b/drivers/md/dm-era-target.c
@@ -1391,7 +1391,8 @@ static int era_is_congested(struct dm_target_callbacks *cb, int bdi_bits)
static void era_destroy(struct era *era)
{
- metadata_close(era->md);
+ if (era->md)
+ metadata_close(era->md);
if (era->wq)
destroy_workqueue(era->wq);