From: Zdenek Kabelac Date: Tue, 28 Feb 2012 11:09:06 +0000 (+0000) Subject: Check result of export_vg_to_buffer X-Git-Tag: v2_02_96~273 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=dec6a245a93f940e9cd902103537ff75a028c836;p=lvm2.git Check result of export_vg_to_buffer and avoid usage of failed buffer. --- diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c index e7bd4b416..695cbed70 100644 --- a/lib/cache/lvmetad.c +++ b/lib/cache/lvmetad.c @@ -518,7 +518,11 @@ int lvmetad_pv_found(struct id pvid, struct device *device, const struct format_ * formatted and has no conflicting keys with the rest of the * request. */ - export_vg_to_buffer(vg, &buf); + if (!export_vg_to_buffer(vg, &buf)) { + dm_free(pvmeta); + return_0; + } + reply = daemon_send_simple(_lvmetad, "pv_found", "pvmeta = %b", pvmeta,