diff --git a/tools/pvmove.c b/tools/pvmove.c index dd68e33d1..c5f9d545e 100644 --- a/tools/pvmove.c +++ b/tools/pvmove.c @@ -627,6 +627,11 @@ static int _pvmove_setup_single(struct cmd_context *cmd, unsigned exclusive; int r = ECMD_FAILED; + if (!vg) { + log_error(INTERNAL_ERROR "Missing volume group."); + return r; + } + pp->found_pv = 1; pp->setup_result = ECMD_FAILED; @@ -761,6 +766,11 @@ static int _pvmove_read_single(struct cmd_context *cmd, struct logical_volume *lv; int ret = ECMD_FAILED; + if (!vg) { + log_error(INTERNAL_ERROR "Missing volume group."); + return ret; + } + pp->found_pv = 1; if (!(lv = find_pvmove_lv(vg, pv_dev(pv), PVMOVE))) {