1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-24 17:57:48 +03:00

coverity: error for undefined origin

If we would have been missing origin here, it would
be an internal error - since these values are validated
earlier.
This commit is contained in:
Zdenek Kabelac 2014-05-07 11:14:22 +02:00
parent a8042f33d0
commit d11617864a
2 changed files with 8 additions and 1 deletions

View File

@ -5993,6 +5993,10 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
"cache-pool")))
return_0;
} else if (seg_is_thin(lp) && lp->snapshot) {
if (!lp->origin) {
log_error(INTERNAL_ERROR "Origin LV is not defined.");
return 0;
}
if (!(org = find_lv(vg, lp->origin))) {
log_error("Couldn't find origin volume '%s'.",
lp->origin);

View File

@ -304,7 +304,10 @@ static int _determine_cache_argument(struct volume_group *vg,
lp->segtype->name);
return 0;
}
if (!lp->origin) {
log_error(INTERNAL_ERROR "Origin LV is not defined.");
return 0;
}
if (!(lvl = find_lv_in_vg(vg, lp->origin))) {
log_error("LV %s not found in Volume group %s.",
lp->origin, vg->name);