Commit 989f26f5 authored by Joe Thornber's avatar Joe Thornber Committed by Mike Snitzer

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: default avatarJoe Thornber <ejt@redhat.com>
Signed-off-by: default avatarNaohiro Aota <naota@elisp.net>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org # 3.15+
parent af91805a
...@@ -1391,6 +1391,7 @@ static int era_is_congested(struct dm_target_callbacks *cb, int bdi_bits) ...@@ -1391,6 +1391,7 @@ static int era_is_congested(struct dm_target_callbacks *cb, int bdi_bits)
static void era_destroy(struct era *era) static void era_destroy(struct era *era)
{ {
if (era->md)
metadata_close(era->md); metadata_close(era->md);
if (era->wq) if (era->wq)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment