diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-02-23 21:36:51 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-02-23 21:40:17 +0100 |
commit | 63c052b9e2a69b94fea33490130e76aac9a8c735 (patch) | |
tree | ddccf5b4661c3f20938b541799616af1b60514f2 | |
parent | ddfec5b51a46faab3f64de3e07dc52e0adaf81bc (diff) | |
download | lvm2-63c052b9e2a69b94fea33490130e76aac9a8c735.tar.gz |
coverity: ensure thin_pool_seg is not NULL
thin_pool_seg being NULL would be an internal error.
-rw-r--r-- | lib/metadata/lv_manip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 64eb6b756..5e4a81ff4 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -1662,8 +1662,10 @@ static int _setup_alloced_segment(struct logical_volume *lv, uint64_t status, lv->size += (uint64_t) extents * lv->vg->extent_size; if (lv_is_thin_pool_data(lv)) { + if (!(thin_pool_seg = get_only_segment_using_this_lv(lv))) + return_0; + /* Update thin pool segment from the layered LV */ - thin_pool_seg = get_only_segment_using_this_lv(lv); thin_pool_seg->lv->le_count = thin_pool_seg->len = thin_pool_seg->area_len = lv->le_count; |