]> sourceware.org Git - lvm2.git/commitdiff
Check result of export_vg_to_buffer
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 28 Feb 2012 11:09:06 +0000 (11:09 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 28 Feb 2012 11:09:06 +0000 (11:09 +0000)
and avoid usage of failed buffer.

lib/cache/lvmetad.c

index e7bd4b416141745efacca7ace8de7285b4ccb63a..695cbed70f30649f73676956ed88bc393c3846c4 100644 (file)
@@ -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,
This page took 0.030752 seconds and 5 git commands to generate.