]> sourceware.org Git - lvm2.git/commitdiff
integrity: fix segfault for lv with no seg
authorDavid Teigland <teigland@redhat.com>
Wed, 2 Sep 2020 14:15:58 +0000 (09:15 -0500)
committerDavid Teigland <teigland@redhat.com>
Wed, 2 Sep 2020 14:15:58 +0000 (09:15 -0500)
in lv_raid_has_integrity

lib/metadata/integrity_manip.c

index 6b2d352a7e260af73a6b7c53b811a56965fa5e6d..5854a2a5206c2af6e309543b61723b1b4f961be0 100644 (file)
@@ -847,7 +847,8 @@ int lv_raid_has_integrity(struct logical_volume *lv)
        struct lv_segment *seg, *seg_image;
        uint32_t s;
 
-       seg = first_seg(lv);
+       if (!(seg = first_seg(lv)))
+               return 0;
 
        if (seg_is_raid(seg)) {
                for (s = 0; s < seg->area_count; s++) {
This page took 0.042953 seconds and 5 git commands to generate.