1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

coverity: validate retval from get_only_segment_using_this_lv

This commit is contained in:
Zdenek Kabelac 2017-06-27 00:24:34 +02:00
parent 664e947726
commit 275fc2d45b
2 changed files with 4 additions and 3 deletions

View File

@ -781,7 +781,8 @@ int lv_info_with_seg_status(struct cmd_context *cmd,
if (lv_is_used_cache_pool(lv)) {
/* INFO is not set as cache-pool cannot be active.
* STATUS is collected from cache LV */
lv_seg = get_only_segment_using_this_lv(lv);
if (!(lv_seg = get_only_segment_using_this_lv(lv)))
return_0;
(void) _lv_info(cmd, lv_seg->lv, 1, NULL, lv_seg, &status->seg_status, 0, 0);
return 1;
}

View File

@ -517,8 +517,8 @@ int lvdisplay_full(struct cmd_context *cmd,
log_print("LV Pool metadata %s", seg->metadata_lv->name);
log_print("LV Pool data %s", seg_lv(seg, 0)->name);
} else if (lv_is_cache_origin(lv)) {
log_print("LV origin of Cache LV %s",
get_only_segment_using_this_lv(lv)->lv->name);
if ((seg = get_only_segment_using_this_lv(lv)))
log_print("LV origin of Cache LV %s", seg->lv->name);
} else if (lv_is_cache(lv)) {
seg = first_seg(lv);
if (inkernel && !lv_cache_status(lv, &cache_status))