Skip to contentSkip to conversation

master - cov: pvscan ensure sigle_devs list is always initialized

PATCH Zdenek Kabelac 1 participant 1 message Oct 15, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c4f39decc8d6fb213af21f16d99b460362ce295f
Commit:        c4f39decc8d6fb213af21f16d99b460362ce295f
Parent:        43e4bfe428cb4e8a953a74aeca5b1942ce6f55a4
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Oct 15 16:57:32 2018 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Oct 15 17:49:44 2018 +0200

cov: pvscan ensure sigle_devs list is always initialized

---
 tools/pvscan.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
tools/pvscan.c +1 -2
index 613a4c4..d110a6b 100644
@@ -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] == '/') {