Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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+

authored by

Joe Thornber and committed by
Mike Snitzer
989f26f5 af91805a

+2 -1
+2 -1
drivers/md/dm-era-target.c
··· 1391 1391 1392 1392 static void era_destroy(struct era *era) 1393 1393 { 1394 - metadata_close(era->md); 1394 + if (era->md) 1395 + metadata_close(era->md); 1395 1396 1396 1397 if (era->wq) 1397 1398 destroy_workqueue(era->wq);