From f410035181d8c524ffc5d0f3edf512e8506b47d9 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 20 Sep 2021 02:09:16 +0200 Subject: [PATCH] cov: check fid instance is created --- tools/pvscan.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/pvscan.c b/tools/pvscan.c index d24ee5724..ec33c9a9a 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -1234,7 +1234,12 @@ static int _online_devs(struct cmd_context *cmd, int do_all, struct dm_list *pvs } fmt = lvmcache_fmt(info); - fid = fmt->ops->create_instance(fmt, &fic); + if (!(fid = fmt->ops->create_instance(fmt, &fic))) { + log_error("pvscan[%d] failed to create format instance.", getpid()); + ret = 0; + continue; + } + vg = NULL; mda1 = lvmcache_get_dev_mda(dev, 1);