1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

Add internal error if pointer is uninitialized

Add simple check for existance of 'pl' and printer internal error message
if device is missing instead of plain crash.
This commit is contained in:
Zdenek Kabelac 2010-12-20 14:20:52 +00:00
parent 6bc840fd2a
commit 952cd45167

View File

@ -263,6 +263,11 @@ static int _read_vg_pds(const struct format_type *fmt, struct dm_pool *mem,
*/
if (!sp_count) {
/* FIXME pl left uninitialised if !info->dev */
if (!pl) {
log_error(INTERNAL_ERROR "device is missing");
dm_pool_destroy(tmpmem);
return 0;
}
sp_count = pl->pd.pl_subpools;
if (!(sp_devs =
dm_pool_zalloc(tmpmem,