diff options
author | Joe Thornber <ejt@redhat.com> | 2014-03-11 16:46:25 (GMT) |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2014-06-03 17:44:08 (GMT) |
commit | 989f26f5ad308f40a95f280bf9cd75e558d4f18d (patch) | |
tree | 035bb4d59ddecce5f2f4f6d868f571cc056ea7d0 /drivers/md | |
parent | af91805a497d3aa694704172b41ba953be3738ed (diff) | |
download | linux-989f26f5ad308f40a95f280bf9cd75e558d4f18d.tar.xz |
dm era: check for a non-NULL metadata object before closing it
era_ctr() may call era_destroy() before era->md is initialized so
era_destory() must only close the metadata object if it is not NULL.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Naohiro Aota <naota@elisp.net>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org # 3.15+
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-era-target.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-era-target.c b/drivers/md/dm-era-target.c index 414dad4..ad913cd 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); |