diff --git a/lib/format_pool/format_pool.c b/lib/format_pool/format_pool.c index 868c98a2e..9482bf96f 100644 --- a/lib/format_pool/format_pool.c +++ b/lib/format_pool/format_pool.c @@ -225,7 +225,7 @@ static int _pool_pv_read(const struct format_type *fmt, const char *pv_name, if (!(pl = read_pool_disk(fmt, dev, mem, NULL))) goto_out; - if (!import_pool_pv(fmt, fmt->cmd->mem, fmt->orphan_vg_name, pv, pl)) + if (!import_pool_pv(fmt, fmt->cmd->mem, NULL, pv, pl)) goto_out; pv->fmt = fmt; diff --git a/lib/format_pool/import_export.c b/lib/format_pool/import_export.c index 6edd374b8..0410d6c1d 100644 --- a/lib/format_pool/import_export.c +++ b/lib/format_pool/import_export.c @@ -165,7 +165,8 @@ int import_pool_pv(const struct format_type *fmt, struct dm_pool *mem, log_error("Unable to duplicate vg_name string"); return 0; } - memcpy(&pv->vgid, &vg->id, sizeof(vg->id)); + if (vg != NULL) + memcpy(&pv->vgid, &vg->id, sizeof(vg->id)); pv->status = 0; pv->size = pd->pl_blocks; pv->pe_size = POOL_PE_SIZE;