From fae0ed8f10bc5771423f2b7af63690800de1ce9f Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 26 Apr 2023 13:38:22 +0200 Subject: cov: ensure there is either vg or error_vg Make it explicitely visible to coverity that _process_pvs_in_vg() is not passing NULL vg. --- tools/toollib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/toollib.c b/tools/toollib.c index 43e628abf..c2d93aaf9 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -4525,7 +4525,8 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags, error_flags = 0; vg = vg_read(cmd, vg_name, vg_uuid, read_flags, lockd_state, &error_flags, &error_vg); - if (_ignore_vg(cmd, error_flags, error_vg, vg_name, NULL, read_flags, &skip, ¬found)) { + if (_ignore_vg(cmd, error_flags, error_vg, vg_name, NULL, read_flags, &skip, ¬found) || + (!vg && !error_vg)) { stack; ret_max = ECMD_FAILED; report_log_ret_code(ret_max); @@ -4535,7 +4536,7 @@ static int _process_pvs_in_vgs(struct cmd_context *cmd, uint32_t read_flags, } if (notfound) goto endvg; - + /* * Don't call "continue" when skip is set, because we need to remove * error_vg->pvs entries from devices list. -- cgit v1.2.1