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+
This commit is contained in:
parent
af91805a49
commit
989f26f5ad
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue