diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index 1d7dc3c6f..4544f265e 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -453,8 +453,9 @@ static struct raw_locn *_find_vg_rlocn(struct device_area *dev_area, "not match expected name %s.", vgname); bad: - if ((info = lvmcache_info_from_pvid(dev_area->dev->pvid, 0))) - lvmcache_update_vgname_and_id(info, &vgsummary_orphan); + if ((info = lvmcache_info_from_pvid(dev_area->dev->pvid, 0)) && + !lvmcache_update_vgname_and_id(info, &vgsummary_orphan)) + stack; return NULL; } diff --git a/lib/label/label.c b/lib/label/label.c index 451040087..bc3c65320 100644 --- a/lib/label/label.c +++ b/lib/label/label.c @@ -105,7 +105,8 @@ static void _update_lvmcache_orphan(struct lvmcache_info *info) memcpy(&vgsummary_orphan.vgid, lvmcache_fmt(info)->orphan_vg_name, strlen(lvmcache_fmt(info)->orphan_vg_name)); - lvmcache_update_vgname_and_id(info, &vgsummary_orphan); + if (!lvmcache_update_vgname_and_id(info, &vgsummary_orphan)) + stack; } static struct labeller *_find_labeller(struct device *dev, char *buf,