mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
Fix first_seg() call for empty segment list.
The seg variable is temporary variable for list iterator, code cannot expect that after iteration it remains NULL (it contains non-NULL pointer here id list is empty). Patch fixes first_seg function so it now correctly returns NULL for empty segment list.
This commit is contained in:
parent
9d81c953c3
commit
6d74246c91
@ -1,5 +1,6 @@
|
||||
Version 2.02.46 -
|
||||
================================
|
||||
Fix first_seg() call for empty segment list.
|
||||
Add make install_lvm2 as complement to device-mapper install.
|
||||
Reject missing PVs from allocation in toollib.
|
||||
Fix PV datalignment for values starting prior to MDA area. (2.02.45)
|
||||
|
@ -1108,12 +1108,12 @@ struct lv_segment *find_seg_by_le(const struct logical_volume *lv, uint32_t le)
|
||||
|
||||
struct lv_segment *first_seg(const struct logical_volume *lv)
|
||||
{
|
||||
struct lv_segment *seg = NULL;
|
||||
struct lv_segment *seg;
|
||||
|
||||
dm_list_iterate_items(seg, &lv->segments)
|
||||
break;
|
||||
return seg;
|
||||
|
||||
return seg;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Find segment at a given physical extent in a PV */
|
||||
|
Loading…
Reference in New Issue
Block a user