1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-27 01:57:55 +03:00

Ensure we always have origin defined

Reported by clang as: Logic error Dereference of null pointer
Make sure the code path could not use NULL origin because of some internal
code error.
This commit is contained in:
Zdenek Kabelac 2010-10-25 12:05:46 +00:00
parent 64cdefc540
commit b1b18e183c

View File

@ -179,6 +179,10 @@ static int _update_extents_params(struct volume_group *vg,
lp->origin);
return 0;
}
if (!origin) {
log_error(INTERNAL_ERROR "Couldn't find origin volume.");
return 0;
}
lp->extents = lp->extents * origin->le_count / 100;
break;
case PERCENT_NONE: