From c4f39decc8d6fb213af21f16d99b460362ce295f Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 15 Oct 2018 16:57:32 +0200 Subject: [PATCH] cov: pvscan ensure sigle_devs list is always initialized --- tools/pvscan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/pvscan.c b/tools/pvscan.c index 613a4c45d..d110a6bd3 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -620,6 +620,7 @@ int pvscan_cache_cmd(struct cmd_context *cmd, int argc, char **argv) int add_errors = 0; int ret = ECMD_PROCESSED; + dm_list_init(&single_devs); dm_list_init(&found_vgnames); if (arg_is_set(cmd, major_ARG) + arg_is_set(cmd, minor_ARG)) @@ -664,8 +665,6 @@ int pvscan_cache_cmd(struct cmd_context *cmd, int argc, char **argv) /* Creates a list of dev names from /dev, sysfs, etc; does not read any. */ dev_cache_scan(); - dm_list_init(&single_devs); - while (argc--) { pv_name = *argv++; if (pv_name[0] == '/') { -- 2.43.5