summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-04-22 15:11:23 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-04-23 23:00:55 +0200
commite1287c3b711d9d77221b0114dbb5ebd84c09ca48 (patch)
tree2a4efcbbc929ee422a0c698b05774c050285a1be
parent04fd55a0c9e721e8d73f067f886736377ba879e3 (diff)
downloadlvm2-e1287c3b711d9d77221b0114dbb5ebd84c09ca48.tar.gz
cov: ensure fid is not null
-rw-r--r--tools/pvscan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 83f3f3983..df38e1758 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -1232,7 +1232,8 @@ static int _online_devs(struct cmd_context *cmd, int do_all, struct dm_list *pvs
if (!vg) {
log_print("pvscan[%d] PV %s has no VG metadata.", getpid(), dev_name(dev));
- fmt->ops->destroy_instance(fid);
+ if (fid)
+ fmt->ops->destroy_instance(fid);
goto online;
}