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:
parent
664e947726
commit
275fc2d45b
@ -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;
|
||||
}
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user