From bed744c15dcb7730a43f22c8cd031c151bd6c020 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 13 Feb 2012 11:09:25 +0000 Subject: [PATCH] Add check for mda_copy failure --- WHATS_NEW | 1 + lib/format_text/format-text.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index 44f2c8ad9..167e46923 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.92 - ==================================== + Add check for mda_copy failure in _text_pv_setup(). Add check for _mirrored_init_target failure. Add free_orphan_vg. Skip pv/vg_set_fid processing if the fid is same. diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index 12e7a2ead..678e0817f 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -1608,7 +1608,8 @@ static int _text_pv_setup(const struct format_type *fmt, /* Be sure it's not already in VG's format instance! */ if (!fid_get_mda_indexed(vg->fid, pvid, ID_LEN, mda_index)) { - pv_mda_copy = mda_copy(vg->fid->mem, pv_mda); + if (!(pv_mda_copy = mda_copy(vg->fid->mem, pv_mda))) + return_0; fid_add_mda(vg->fid, pv_mda_copy, pvid, ID_LEN, mda_index); } }