]> sourceware.org Git - lvm2.git/commitdiff
Check str_list_add() success
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 1 Dec 2010 13:05:06 +0000 (13:05 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 1 Dec 2010 13:05:06 +0000 (13:05 +0000)
Report error if str_list_add fails.

WHATS_NEW
lib/format_pool/import_export.c

index 2eda317bacbd1c36400f256be12ce0c6a5980b55..e4aaba5d2c102b57e10b8bf52a10be706f60d7b1 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.78 - 
 ====================================
+  Check str_list_add() success in _add_stripe_seg().
   Check lv_info() success in _mirrored_transient_status().
   Add backtraces for dev_set() and dev_close_immediate() errors in set_lv().
   Add logging for unlink() error in clvmd remove_lockfile().
index 07f67fd424b1ad683e77aeefd4d125e639d73999..788424714e886cac1e349135a137cecda7f48679 100644 (file)
@@ -206,7 +206,10 @@ static int _add_stripe_seg(struct dm_pool *mem,
                        return_0;
 
        /* add the subpool type to the segment tag list */
-       str_list_add(mem, &seg->tags, _cvt_sptype(usp->type));
+       if (!str_list_add(mem, &seg->tags, _cvt_sptype(usp->type))) {
+               log_error("Allocation failed for str_list.");
+               return 0;
+       }
 
        dm_list_add(&lv->segments, &seg->list);
 
@@ -240,7 +243,10 @@ static int _add_linear_seg(struct dm_pool *mem,
                }
 
                /* add the subpool type to the segment tag list */
-               str_list_add(mem, &seg->tags, _cvt_sptype(usp->type));
+               if (!str_list_add(mem, &seg->tags, _cvt_sptype(usp->type))) {
+                       log_error("Allocation failed for str_list.");
+                       return 0;
+               }
 
                if (!set_lv_segment_area_pv(seg, 0, usp->devs[j].pv, 0))
                        return_0;
This page took 0.047842 seconds and 5 git commands to generate.